Fix leak of kmod_module
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Sun, 18 Dec 2011 03:35:30 +0000 (01:35 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Sun, 18 Dec 2011 03:35:30 +0000 (01:35 -0200)
test/test-lookup.c

index e68832c..41616e8 100644 (file)
@@ -116,6 +116,7 @@ int main(int argc, char *argv[])
                                kmod_list_foreach(d, pre) {
                                        struct kmod_module *dm = kmod_module_get_module(d);
                                        printf(" %s", kmod_module_get_name(dm));
+                                       kmod_module_unref(dm);
                                }
                                putchar('\n');
                                kmod_module_unref_list(pre);
@@ -125,6 +126,7 @@ int main(int argc, char *argv[])
                                kmod_list_foreach(d, post) {
                                        struct kmod_module *dm = kmod_module_get_module(d);
                                        printf(" %s", kmod_module_get_name(dm));
+                                       kmod_module_unref(dm);
                                }
                                putchar('\n');
                                kmod_module_unref_list(post);