From: Felix Fietkau Date: Mon, 18 Aug 2008 19:49:13 +0000 (+0200) Subject: fix wrong buffer allocation X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=236f7468c5eb30f1381a7059cf780b7fe173ec48;p=uci.git fix wrong buffer allocation --- diff --git a/list.c b/list.c index ab40bda..2331c7e 100644 --- a/list.c +++ b/list.c @@ -469,7 +469,7 @@ int uci_add_element_list(struct uci_context *ctx, struct uci_option *o, const ch if (!internal && p->has_history) uci_add_history(ctx, &p->history, UCI_CMD_LIST_ADD, s->e.name, o->e.name, value); - e = uci_alloc_generic(ctx, UCI_TYPE_ITEM, value, 0); + e = uci_alloc_generic(ctx, UCI_TYPE_ITEM, value, sizeof(struct uci_option)); uci_list_add(&o->v.list, &e->list); return 0;