# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1197967850 -3600
# Node ID fcb43d2882bc6925c41b7e451e6c41e42d430025
# Parent 7dde77938c45866d0200d647d312407118abdc1a
SDC: harden free_rasd_prop_list to handle NULL pointer
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 7dde77938c45 -r fcb43d2882bc src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Tue Dec 18 10:19:52 2007 +0800
+++ b/src/Virt_SettingsDefineCapabilities.c Tue Dec 18 09:50:50 2007 +0100
@@ -89,17 +89,19 @@ static bool dup_rasd_prop_list(struct sd
return true;
}
-static bool free_rasd_prop_list(struct sdc_rasd_prop *prop_list)
+static void free_rasd_prop_list(struct sdc_rasd_prop *prop_list)
{
int i;
+
+ if (!prop_list)
+ return;
for (i = 0; prop_list[i].field != NULL; i++) {
free(prop_list[i].field);
free(prop_list[i].value);
}
-
+
free (prop_list);
- return true;
}
static struct sdc_rasd_prop *mem_max(const CMPIObjectPath *ref,