This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Do we care about malloc failure in tests?


Greetings,

We have a few bugs opened by Bill, e.g.: BZ #19672, BZ #19668
complaining about this pattern in tests:

  char *p = malloc(20);
  p[0] = '\0';  // did not check against NULL.

I spot-checked other existing tests:

libio/tst-atime.c
libio/tst-fopenloc.c
libio/tst-ftell-partial-wide.c
libio/tst-mmap2-eofsync.c

Two of them check for NULL, and two do not.

Do we have a policy here?
Should I fix them to consistently check for NULL, or delete existing
NULL checks?

Thanks,
-- 
Paul Pluzhnikov


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]