From d1f90d076990c1a54c0af1fc6f8d9f3547a2aa63 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Wed, 1 Sep 2004 15:31:34 +0000 Subject: [PATCH] * libltdl/slist.c (slist_new): Handle malloc failure gracefully. --- ChangeLog | 4 ++++ libltdl/slist.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ca4e1c4..edf31703 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 fca530a6..e24b092d 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; }