projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
53f5cd2
)
Merge branch 'collectd-4.2' into collectd-4.3
author
Florian Forster
<octo@huhu.verplant.org>
Sat, 22 Mar 2008 08:40:00 +0000
(09:40 +0100)
committer
Florian Forster
<octo@huhu.verplant.org>
Sat, 22 Mar 2008 08:40:00 +0000
(09:40 +0100)
src/liboconfig/oconfig.c
patch
|
blob
|
history
diff --git
a/src/liboconfig/oconfig.c
b/src/liboconfig/oconfig.c
index
2bb80cc
..
db9285b
100644
(file)
--- a/
src/liboconfig/oconfig.c
+++ b/
src/liboconfig/oconfig.c
@@
-76,11
+76,25
@@
void oconfig_free (oconfig_item_t *ci)
{
int i;
+ if (ci == NULL)
+ return;
+
+ if (ci->key != NULL)
+ free (ci->key);
+
+ for (i = 0; i < ci->values_num; i++)
+ if ((ci->values[i].type == OCONFIG_TYPE_STRING)
+ && (NULL != ci->values[i].value.string))
+ free (ci->values[i].value.string);
+
if (ci->values != NULL)
free (ci->values);
for (i = 0; i < ci->children_num; i++)
oconfig_free (ci->children + i);
+
+ if (ci->children != NULL)
+ free (ci->children);
}
/*