diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2004-09-03 01:31:58 +0000 |
---|---|---|
committer | Gary V. Vaughan <gary@gnu.org> | 2004-09-03 01:31:58 +0000 |
commit | 10c92f19ebc0211d2e3c877cc77f31d36bde75be (patch) | |
tree | e5364eee390af8e95c95c658bc8a69d67ec7d6bb /libltdl/slist.c | |
parent | 206543bc66469793e74fc6050cd6ce7f3aaadb7e (diff) | |
download | libtool-10c92f19ebc0211d2e3c877cc77f31d36bde75be.tar.gz |
* libltdl/slist.c (slist_cons): Don't leak the tail of a list.
Diffstat (limited to 'libltdl/slist.c')
-rw-r--r-- | libltdl/slist.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libltdl/slist.c b/libltdl/slist.c index 06ccf346..ae2c0590 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); */ |