mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-04 08:17:12 +03:00
Cleanup remove test for NULL
dm_free is testing NULL itself
This commit is contained in:
parent
a2f5ce8181
commit
8661190736
@ -250,10 +250,8 @@ int dm_task_set_name(struct dm_task *dmt, const char *name)
|
||||
char path[PATH_MAX];
|
||||
struct stat st1, st2;
|
||||
|
||||
if (dmt->dev_name) {
|
||||
dm_free(dmt->dev_name);
|
||||
dmt->dev_name = NULL;
|
||||
}
|
||||
dm_free(dmt->dev_name);
|
||||
dmt->dev_name = NULL;
|
||||
|
||||
/*
|
||||
* Path supplied for existing device?
|
||||
@ -292,8 +290,7 @@ int dm_task_set_name(struct dm_task *dmt, const char *name)
|
||||
|
||||
if (strlen(name) >= DM_NAME_LEN) {
|
||||
log_error("Name \"%s\" too long", name);
|
||||
if (new_name)
|
||||
dm_free(new_name);
|
||||
dm_free(new_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -309,10 +306,7 @@ int dm_task_set_name(struct dm_task *dmt, const char *name)
|
||||
|
||||
int dm_task_set_uuid(struct dm_task *dmt, const char *uuid)
|
||||
{
|
||||
if (dmt->uuid) {
|
||||
dm_free(dmt->uuid);
|
||||
dmt->uuid = NULL;
|
||||
}
|
||||
dm_free(dmt->uuid);
|
||||
|
||||
if (!(dmt->uuid = dm_strdup(uuid))) {
|
||||
log_error("dm_task_set_uuid: strdup(%s) failed", uuid);
|
||||
|
Loading…
Reference in New Issue
Block a user