From: Emil Velikov Date: Fri, 13 Jun 2025 19:12:28 +0000 (+0100) Subject: testsuite/test-remove: plug memory leaks in success path X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bcdf71a1efa9e3f6acadf3d249bd7021f8452240;p=thirdparty%2Fkmod.git testsuite/test-remove: plug memory leaks in success path With the upcoming patches, removing exit() usage, ASan started reporting that our test leaks kmod_module handles. Resolve those leaks - we shouldn't be doing that in the normal (success) path. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/371 Signed-off-by: Lucas De Marchi --- diff --git a/testsuite/test-remove.c b/testsuite/test-remove.c index 1cf47d8e..ed5cc31e 100644 --- a/testsuite/test-remove.c +++ b/testsuite/test-remove.c @@ -51,6 +51,7 @@ static noreturn int test_remove(void) ERR("could not remove module directory.\n"); exit(EXIT_FAILURE); } + kmod_module_unref(mod); kmod_unref(ctx); exit(EXIT_SUCCESS);