1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Report error if NULL pointer supplied to dm_strdup_aux().

This commit is contained in:
Alasdair Kergon 2007-01-15 14:39:12 +00:00
parent c975a100b1
commit 43243f4d30
2 changed files with 8 additions and 2 deletions

View 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

View File

@ -20,9 +20,14 @@
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;