1
0
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:
Zdenek Kabelac 2017-06-26 23:57:12 +02:00
parent 72c5598658
commit 664e947726
2 changed files with 6 additions and 2 deletions

View File

@ -709,7 +709,8 @@ static int _dmfilemapd(struct filemap_monitor *fm)
* The correct program_id is retrieved from the group leader * The correct program_id is retrieved from the group leader
* following the call to dm_stats_list(). * 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)) { if (!dm_stats_bind_from_fd(dms, fm->fd)) {
log_error("Could not bind dm_stats handle to file descriptor " log_error("Could not bind dm_stats handle to file descriptor "

View File

@ -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 */ /* each command should start out with sigint flag cleared */
sigint_clear(); 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); configure_command_option_values(cmd->name);