projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78f76bd
)
plug a memleak
author
Felix Fietkau
<nbd@openwrt.org>
Wed, 30 Jan 2008 02:14:49 +0000
(
03:14
+0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Wed, 30 Jan 2008 02:14:49 +0000
(
03:14
+0100)
list.c
patch
|
blob
|
history
diff --git
a/list.c
b/list.c
index 18de500445990ef167963357d4f55095aa435385..bd70857abdb1af2bc5e71748d327f95099e30bf9 100644
(file)
--- a/
list.c
+++ b/
list.c
@@
-102,6
+102,9
@@
uci_alloc_option(struct uci_section *s, const char *name, const char *value)
static inline void
uci_free_option(struct uci_option *o)
{
+ if ((o->value != uci_dataptr(o)) &&
+ (o->value != NULL))
+ free(o->value);
uci_free_element(&o->e);
}
@@
-135,6
+138,9
@@
uci_free_section(struct uci_section *s)
uci_foreach_element_safe(&s->options, tmp, o) {
uci_free_option(uci_to_option(o));
}
+ if ((s->type != uci_dataptr(s)) &&
+ (s->type != NULL))
+ free(s->type);
uci_free_element(&s->e);
}