mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
coverity: add some error path for failed allocs
Coverity reports some unchecked allocations.
This commit is contained in:
parent
72c5598658
commit
664e947726
@ -709,7 +709,8 @@ static int _dmfilemapd(struct filemap_monitor *fm)
|
||||
* The correct program_id is retrieved from the group leader
|
||||
* following the call to dm_stats_list().
|
||||
*/
|
||||
dms = dm_stats_create(NULL);
|
||||
if (!(dms = dm_stats_create(NULL)))
|
||||
goto_bad;
|
||||
|
||||
if (!dm_stats_bind_from_fd(dms, fm->fd)) {
|
||||
log_error("Could not bind dm_stats handle to file descriptor "
|
||||
|
@ -2703,7 +2703,10 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
|
||||
/* each command should start out with sigint flag cleared */
|
||||
sigint_clear();
|
||||
|
||||
cmd->name = dm_pool_strdup(cmd->mem, dm_basename(argv[0]));
|
||||
if (!(cmd->name = dm_pool_strdup(cmd->mem, dm_basename(argv[0])))) {
|
||||
log_error("Failed to strdup command basename.");
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
|
||||
configure_command_option_values(cmd->name);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user