From cc848ddbf82500fd0d8c42c0e77b5c456805095b Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 11 May 2006 18:25:24 +0000 Subject: Bug fix from Vladimir Oleynik, and suggestion I add my copyright notice to the file. --- libbb/llist.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libbb/llist.c') 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 * * 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; -- cgit v1.2.3