Package: zlib1g-dev
Severity: wishlist
Version: 1:1.2.3-9

gzerror() returns a string and sets an integer pointer parameter.  But
it isn't clear to me whether the returned string is mallocated, or a
pointer to a string in a table of error messages, or anything else.
In particular, I don't know if I need to free() the returned pointer,
and I don't know if the value is overwritten by successive failures
(though I can't why it would be implemented in any way that cause
this, I guess it is best to ask).

I just tried it, and free()ing the returned pointer isn't valid,
according to valgrind, and, as before, I don't see any reason that a
static buffer should need to be overwritten.  So, if this is correct,
please document.

However, I just checked the code, and it seems that the error message is
*sometimes* mallocated, and *sometimes* an element of a static string
list.  Please document, at least, that the returned pointer should not
be freed (since, even if it is mallocated, it is presumably freed with
the stream, and we want consistency and to avoid a double free..)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to