LVM2/libdm libdm-common.c
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2010-11-29 10:11:51
Modified files:
libdm : libdm-common.c
Log message:
Cleanup remove test for NULL
dm_free is testing NULL itself
libdm/libdm-common.c +4 -10
@@ -250,10 +250,8 @@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 @@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_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);