aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-02-17 21:38:26 +0200
committerSergey Poznyakoff <gray@gnu.org>2019-02-17 21:40:57 +0200
commit6f4c5ec9673268150d198ed7a139f5566eea41e8 (patch)
treea29eabcdeb8db8763ed57398cc753458d26d2b24
parent8bd14b9079e6a21820bd816fe99e929ea6c24f4f (diff)
downloaddico-6f4c5ec9673268150d198ed7a139f5566eea41e8.tar.gz
dico-6f4c5ec9673268150d198ed7a139f5566eea41e8.tar.bz2
Fix attempted access to deallocated memory
* lib/list.c (_dico_list_remove_item): Free entry after accessing its fields.
-rw-r--r--lib/list.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/list.c b/lib/list.c
index cbdb406..46a9de4 100644
--- a/lib/list.c
+++ b/lib/list.c
@@ -484,13 +484,14 @@ _dico_list_remove_item(struct dico_list *list, struct list_entry *p,
else
list->tail = prev;
- free(p);
list->count--;
if (pptr)
*pptr = p->data;
else if (list->free_item)
list->free_item (p->data, list->free_data);
+
+ free(p);
}
int

Return to:

Send suggestions and report system problems to the System administrator.