From 7fcb4d9c30486692cb865fc889d8d0770abae6d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20W=C3=BCrdig?= Date: Wed, 6 Sep 2006 13:54:42 +0000 Subject: [PATCH] fixed plist_new when no obstack is given [r8182] --- ir/adt/plist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ir/adt/plist.c b/ir/adt/plist.c index 9c4261dcf..7016f57d5 100644 --- a/ir/adt/plist.c +++ b/ir/adt/plist.c @@ -39,7 +39,9 @@ static plist_element_t *allocate_element(plist_t* list) { plist_t* plist_new(void) { plist_t* list = xmalloc(sizeof(*list)); + list->obst = xmalloc(sizeof(*list->obst)); obstack_init(list->obst); + list->foreign_obstack = 0; list->first_element = NULL; list->last_element = NULL; @@ -70,6 +72,7 @@ void plist_free(plist_t *list) { if (! list->foreign_obstack) { obstack_free(list->obst, NULL); + xfree(list->obst); xfree(list); } } -- 2.20.1