From: Ralf Wildenhues Date: Wed, 1 Sep 2004 15:31:34 +0000 (+0000) Subject: * libltdl/slist.c (slist_new): Handle malloc failure gracefully. X-Git-Tag: release-1-9d~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1f90d076990c1a54c0af1fc6f8d9f3547a2aa63;p=thirdparty%2Flibtool.git * libltdl/slist.c (slist_new): Handle malloc failure gracefully. --- diff --git a/ChangeLog b/ChangeLog index 1ca4e1c42..edf31703c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-09-01 Ralf Wildenhues + + * libltdl/slist.c (slist_new): Handle malloc failure gracefully. + 2004-09-01 Gary V. Vaughan * libtoolize.in, config/ltmain.in: Add CDPATH protection to diff --git a/libltdl/slist.c b/libltdl/slist.c index fca530a6f..e24b092da 100644 --- a/libltdl/slist.c +++ b/libltdl/slist.c @@ -37,8 +37,11 @@ slist_new (const void *userdata) { SList *node = malloc (sizeof *node); - node->next = 0; - node->userdata = userdata; + if (node) + { + node->next = 0; + node->userdata = userdata; + } return node; }