From: Ralf Wildenhues Date: Fri, 3 Sep 2004 01:31:58 +0000 (+0000) Subject: * libltdl/slist.c (slist_cons): Don't leak the tail of a list. X-Git-Tag: release-1-9d~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10c92f19ebc0211d2e3c877cc77f31d36bde75be;p=thirdparty%2Flibtool.git * libltdl/slist.c (slist_cons): Don't leak the tail of a list. --- diff --git a/ChangeLog b/ChangeLog index c90ba2e1d..5dd1fca3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-09-03 Ralf Wildenhues + + * libltdl/slist.c (slist_cons): Don't leak the tail of a list. + 2004-09-03 Albert Chin-A-Young * m4/libtool.m4 (_LT_ENABLE_LOCK): Reformatted. diff --git a/libltdl/slist.c b/libltdl/slist.c index 06ccf346f..ae2c0590f 100644 --- a/libltdl/slist.c +++ b/libltdl/slist.c @@ -165,6 +165,8 @@ slist_cons (SList *item, SList *slist) return slist; } + assert (!item->next); + item->next = slist; return item; } @@ -206,7 +208,7 @@ slist_length (SList *slist) /* Destructively reverse the order of items in SLIST. The value of SLIST is undefined after calling this function. - CAVEAT: You must stare the result of this function, or you might not + CAVEAT: You must store the result of this function, or you might not be able to get all the items except the first one back again. e.g. slist = slist_reverse (slist); */