summaryrefslogtreecommitdiff
path: root/libbb/llist.c
diff options
context:
space:
mode:
authorRob Landley2006-05-11 18:25:24 +0000
committerRob Landley2006-05-11 18:25:24 +0000
commitcc848ddbf82500fd0d8c42c0e77b5c456805095b (patch)
tree069cdabe857272bb415df0aa308ef2ffe887af86 /libbb/llist.c
parent0690d1591fa7582132471eba7a3e46816631307e (diff)
downloadbusybox-cc848ddbf82500fd0d8c42c0e77b5c456805095b.zip
busybox-cc848ddbf82500fd0d8c42c0e77b5c456805095b.tar.gz
Bug fix from Vladimir Oleynik, and suggestion I add my copyright notice
to the file.
Diffstat (limited to 'libbb/llist.c')
-rw-r--r--libbb/llist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libbb/llist.c b/libbb/llist.c
index 0d599db..842e8f7 100644
--- a/libbb/llist.c
+++ b/libbb/llist.c
@@ -5,6 +5,7 @@
* Copyright (C) 2003 Glenn McGrath
* Copyright (C) 2005 Vladimir Oleynik
* Copyright (C) 2005 Bernhard Fischer
+ * Copyright (C) 2006 Rob Landley <rob@landley.net>
*
* Licensed under the GPL v2, see the file LICENSE in this tarball.
*/
@@ -57,8 +58,8 @@ void *llist_pop(llist_t **head)
else {
void *next = (*head)->link;
data = (*head)->data;
- *head = (*head)->link;
- free(next);
+ free(*head);
+ *head = next;
}
return data;