Free the buffer before return. Also check the malloc return value.
Perhaps it's not a good idea to exit() on error, but it's in line with the
rest of the function.
Strange thing with this function is that the allocated buffer doesn't seem
to be used for anything. The data read into it doesn't
Andreas Fritiofson wrote:
Strange thing with this function is that the allocated buffer doesn't seem
to be used for anything. The data read into it doesn't go anywhere. Maybe
the entire function is flawed, or is the data really supposed to be
discarded?
If noone can answer this then I would
On Thu, Jun 9, 2011 at 8:37 AM, Peter Stuge pe...@stuge.se wrote:
Andreas Fritiofson wrote:
Strange thing with this function is that the allocated buffer doesn't seem
to be used for anything. The data read into it doesn't go anywhere. Maybe
the entire function is flawed, or is the data really
Definitely! I'm holding off on this patch in favor of a patch that deletes
cruft instead of decorating it :-)
I have a soft spot for patches that delete code that nobody
understands
--
Øyvind Harboe
Can Zylin Consulting help on your project?
US toll free 1-866-980-3434 / International
On Thu, Jun 9, 2011 at 8:40 AM, Øyvind Harboe oyvind.har...@zylin.comwrote:
Definitely! I'm holding off on this patch in favor of a patch that
deletes
cruft instead of decorating it :-)
I have a soft spot for patches that delete code that nobody
understands
IF the function is
Free the buffer before return. Also check the malloc return value.
Perhaps it's not a good idea to exit() on error, but it's in line with the
rest of the function.
Strange thing with this function is that the allocated buffer doesn't seem
to be used for anything. The data read into it doesn't go