]> sourceware.org Git - lvm2.git/commitdiff
Report error if NULL pointer supplied to dm_strdup_aux().
authorAlasdair Kergon <agk@redhat.com>
Mon, 15 Jan 2007 14:39:12 +0000 (14:39 +0000)
committerAlasdair Kergon <agk@redhat.com>
Mon, 15 Jan 2007 14:39:12 +0000 (14:39 +0000)
WHATS_NEW_DM
libdm/mm/dbg_malloc.c

index df9b6b414da21d57879397ecff494b04f872ed95..3eb81fc0ff7481457debd6c42db25d3df4942b48 100644 (file)
@@ -1,5 +1,6 @@
 Version 1.02.15 -
 ===================================
+  Report error if NULL pointer is supplied to dm_strdup_aux().
   Reinstate dm_event_get_registered_device.
 
 Version 1.02.14 - 11th January 2007
index 8986b21e272238b9236b941971a2f81c0aba5789..54d83840151f99ad7958bdf235c90c3746b90045 100644 (file)
 
 char *dm_strdup_aux(const char *str, const char *file, int line)
 {
-       char *ret = dm_malloc_aux_debug(strlen(str) + 1, file, line);
+       char *ret;
 
-       if (ret)
+       if (!str) {
+               log_error("Internal error: dm_strdup called with NULL pointer");
+               return NULL;
+       }
+
+       if ((ret = dm_malloc_aux_debug(strlen(str) + 1, file, line)))
                strcpy(ret, str);
 
        return ret;
This page took 0.035573 seconds and 5 git commands to generate.