1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Skip NULL check before dm_free

dm_free checks for NULL itself.
This commit is contained in:
Zdenek Kabelac 2011-01-28 10:16:04 +00:00
parent 65fc4dae3a
commit a5c6acf22a
4 changed files with 8 additions and 21 deletions

View File

@ -69,7 +69,6 @@ void archive_exit(struct cmd_context *cmd)
{
if (!cmd->archive_params)
return;
if (cmd->archive_params->dir)
dm_free(cmd->archive_params->dir);
memset(cmd->archive_params, 0, sizeof(*cmd->archive_params));
}
@ -183,7 +182,6 @@ void backup_exit(struct cmd_context *cmd)
{
if (!cmd->backup_params)
return;
if (cmd->backup_params->dir)
dm_free(cmd->backup_params->dir);
memset(cmd->backup_params, 0, sizeof(*cmd->backup_params));
}

View File

@ -279,7 +279,6 @@ static int _cluster_request(char clvmd_cmd, const char *node, void *data, int le
*response = rarray;
out:
if (retbuf)
dm_free(retbuf);
return status;

View File

@ -125,6 +125,5 @@ int cmp_timestamp(struct timestamp *t1, struct timestamp *t2)
void destroy_timestamp(struct timestamp *t)
{
if (t)
dm_free(t);
}

View File

@ -486,20 +486,11 @@ void dm_task_destroy(struct dm_task *dmt)
dm_free(t);
}
if (dmt->dev_name)
dm_free(dmt->dev_name);
if (dmt->newname)
dm_free(dmt->newname);
if (dmt->message)
dm_free(dmt->message);
_dm_zfree_dmi(dmt->dmi.v4);
if (dmt->uuid)
dm_free(dmt->dev_name);
dm_free(dmt->newname);
dm_free(dmt->message);
dm_free(dmt->uuid);
dm_free(dmt);
}