summaryrefslogtreecommitdiff
path: root/libkmod/libkmod-index.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2011-12-10 13:28:18 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2011-12-10 13:28:18 -0200
commit27fdf63153ec5786ae39f3e37a89111f552e5097 (patch)
tree62bdc2e174e27f94c966a4ba558c53ade73ef285 /libkmod/libkmod-index.c
parentd09154644814b6f013ce24b6eb7fed076230c916 (diff)
downloadkmod-27fdf63153ec5786ae39f3e37a89111f552e5097.tar.gz
kmod-27fdf63153ec5786ae39f3e37a89111f552e5097.tar.bz2
kmod-27fdf63153ec5786ae39f3e37a89111f552e5097.zip
index: fix memleak for non-matchin aliases.
Diffstat (limited to 'libkmod/libkmod-index.c')
-rw-r--r--libkmod/libkmod-index.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c
index 8424271..cc54473 100644
--- a/libkmod/libkmod-index.c
+++ b/libkmod/libkmod-index.c
@@ -483,6 +483,8 @@ static void index_searchwild__all(struct index_node_f *node, int j,
if (node->values) {
if (fnmatch(buf_str(buf), subkey, 0) == 0)
index_searchwild__allvalues(node, out);
+ else
+ index_close(node);
} else {
index_close(node);
}
@@ -907,6 +909,8 @@ static void index_mm_searchwild_all(struct index_mm_node *node, int j,
if (node->values.len > 0) {
if (fnmatch(buf_str(buf), subkey, 0) == 0)
index_mm_searchwild_allvalues(node, out);
+ else
+ index_mm_free_node(node);
} else {
index_mm_free_node(node);
}