1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-06-24 19:16:58 +03:00

coverity cleanups

This commit is contained in:
David Teigland 2021-06-16 13:22:54 -05:00
parent f70d97b916
commit 71cb54d92f
3 changed files with 9 additions and 2 deletions

View File

@ -854,6 +854,11 @@ next:
dev_name(dev1), has_lv1 ? "is used for" : "is not used for",
dev_name(dev2), has_lv2 ? "is used for" : "is not used for");
free((void *)idname1);
free((void *)idname2);
idname1 = NULL;
idname2 = NULL;
change = 0;
if (prev_unchosen1 && !prev_unchosen2) {

View File

@ -1132,6 +1132,7 @@ id_done:
if (yes_no_prompt("Add device with duplicate PV to devices file?") == 'n') {
log_print("Device not added.");
free((void *)check_idname);
return 1;
}
}

View File

@ -3053,7 +3053,7 @@ int pvck(struct cmd_context *cmd, int argc, char **argv)
}
}
if (arg_is_set(cmd, dump_ARG)) {
if ((dump = arg_str_value(cmd, dump_ARG, NULL))) {
struct stat sb;
pv_name = argv[0];
@ -3121,7 +3121,7 @@ int pvck(struct cmd_context *cmd, int argc, char **argv)
}
}
if ((dump = arg_str_value(cmd, dump_ARG, NULL))) {
if (dump) {
cmd->use_hints = 0;
if (!strcmp(dump, "metadata"))
@ -3145,6 +3145,7 @@ int pvck(struct cmd_context *cmd, int argc, char **argv)
} else
log_error("Unknown dump value.");
free(def);
if (!ret)
return ECMD_FAILED;
return ECMD_PROCESSED;