You allocated 10 bytes, and stored a pointer to those bytes (xyz->abc
) then you immediately replaced that pointer with a pointer to a string literal ("abcdefghi\0"
).
There are several problems with your program:
- Ten leaked bytes
- Excess
\0
in string literal — why? -
free
-ing something…
Top comments (0)