mirror of
https://github.com/samba-team/samba.git
synced 2025-12-12 12:23:50 +03:00
return NULL for a zero size memdup
This commit is contained in:
@@ -2581,6 +2581,7 @@ like strdup but for memory
|
||||
void *memdup(void *p, size_t size)
|
||||
{
|
||||
void *p2;
|
||||
if (size == 0) return NULL;
|
||||
p2 = malloc(size);
|
||||
if (!p2) return NULL;
|
||||
memcpy(p2, p, size);
|
||||
|
||||
Reference in New Issue
Block a user