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:
parent
c975a100b1
commit
43243f4d30
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user