From: Tobias Stoeckmann Date: Fri, 16 Aug 2024 21:54:57 +0000 (+0200) Subject: depmod: Remove unneeded check X-Git-Tag: v34~497 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=34aaf08e51b50e020ae71eebdf04286f992c15a8;p=thirdparty%2Fkmod.git depmod: Remove unneeded check Calling free(NULL) is valid. No need for previous if-check. Signed-off-by: Tobias Stoeckmann Reviewed-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/79 Signed-off-by: Lucas De Marchi --- diff --git a/tools/depmod.c b/tools/depmod.c index 8ba8ee40..03fcff33 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -2934,8 +2934,7 @@ static int do_depmod(int argc, char *argv[]) maybe_all = 1; break; case 'b': - if (root) - free(root); + free(root); root = path_make_absolute_cwd(optarg); if (root == NULL) { ERR("invalid image path %s\n", optarg); @@ -2943,8 +2942,7 @@ static int do_depmod(int argc, char *argv[]) } break; case 'o': - if (out_root) - free(out_root); + free(out_root); out_root = path_make_absolute_cwd(optarg); if (out_root == NULL) { ERR("invalid output directory %s\n", optarg);