I: [PATCH] asprintf error handling fix

Andreas Jaeger aj@suse.de
Wed Dec 12 10:11:00 GMT 2001


I've found the BSD man page and it explictly mentions setting the
buffer to NULl:

     asprintf() and vasprintf() return a pointer to a buffer sufficiently
     large to hold the string in the ret argument.  This pointer should be
     passed to free(3) to release the allocated storage when it is no longer
     needed.  If sufficient space cannot be allocated, these functions will
     return -1 and set ret to be a null pointer.

IMO we should change glibc therefore to align with BSD,

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Libc-alpha mailing list