From: Emil Velikov Date: Fri, 6 Sep 2024 21:40:03 +0000 (+0100) Subject: libkmod: smoke test all the API X-Git-Tag: v34~394 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4731bed9df2c793004473dd408b80cd90d22071c;p=thirdparty%2Fkmod.git libkmod: smoke test all the API Aka make sure the library does not crash if we give it a NULL as input argument. All entry-points but kmod_config_iter_free_iter look to be safe. Update the final instance. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/111 Signed-off-by: Lucas De Marchi --- diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c index 343183f3..9fda8535 100644 --- a/libkmod/libkmod-config.c +++ b/libkmod/libkmod-config.c @@ -1320,6 +1320,7 @@ KMOD_EXPORT bool kmod_config_iter_next(struct kmod_config_iter *iter) KMOD_EXPORT void kmod_config_iter_free_iter(struct kmod_config_iter *iter) { - free(iter->data); + if (iter) + free(iter->data); free(iter); }