From: Rob Landley <rob@landley.net>
Date: Thu, 11 May 2006 18:25:24 +0000 (-0000)
Subject: Bug fix from Vladimir Oleynik, and suggestion I add my copyright notice
X-Git-Tag: 1_2_0~375
X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cc848ddbf82500fd0d8c42c0e77b5c456805095b;p=oweals%2Fbusybox.git

Bug fix from Vladimir Oleynik, and suggestion I add my copyright notice
to the file.
---

diff --git a/libbb/llist.c b/libbb/llist.c
index 0d599db6b..842e8f7bb 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;