Calling free(NULL) is valid. No need for previous if-check.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/79
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
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);
}
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);