main - coverity cleanups
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=71cb54d92f96b8da318c8f8380e7ce0bdf0a11bf Commit: 71cb54d92f96b8da318c8f8380e7ce0bdf0a11bf Parent: f70d97b91620bc7c2e5c5ccc39913c54379322c2 Author: David Teigland <[email protected]> AuthorDate: Wed Jun 16 13:22:54 2021 -0500 Committer: David Teigland <[email protected]> CommitterDate: Wed Jun 16 13:42:51 2021 -0500
coverity cleanups
--- lib/cache/lvmcache.c | 5 +++++ lib/device/device_id.c | 1 + tools/pvck.c | 5 +++-- 3 files changed, 9 insertions(+), 2 deletions(-)
lib/cache/lvmcache.c +5 -0
@@ -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) {
lib/device/device_id.c +1 -0
@@ -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 ; } }
tools/pvck.c +3 -2
@@ -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 ;