This is the mail archive of the
mailing list for the glibc project.
Do we care about malloc failure in tests?
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: GLIBC Devel <libc-alpha at sourceware dot org>
- Cc: Bill Parker <wp02855 at gmail dot com>
- Date: Mon, 30 May 2016 15:44:49 -0700
- Subject: Do we care about malloc failure in tests?
- Authentication-results: sourceware.org; auth=none
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'; // did not check against NULL.
I spot-checked other existing tests:
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