diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-02-17 21:38:26 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-02-17 21:40:57 +0200 |
commit | 6f4c5ec9673268150d198ed7a139f5566eea41e8 (patch) | |
tree | a29eabcdeb8db8763ed57398cc753458d26d2b24 | |
parent | 8bd14b9079e6a21820bd816fe99e929ea6c24f4f (diff) | |
download | dico-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |