From 10c92f19ebc0211d2e3c877cc77f31d36bde75be Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Fri, 3 Sep 2004 01:31:58 +0000 Subject: [PATCH] * libltdl/slist.c (slist_cons): Don't leak the tail of a list. --- ChangeLog | 4 ++++ libltdl/slist.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) 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); */ -- 2.47.2