skipping strdup on NULL string param
This commit is contained in:
parent
4649b7ccf6
commit
ea018644f2
@ -166,6 +166,8 @@ void *why2_recalloc(void *pointer, unsigned long size, unsigned long block_size)
|
|||||||
|
|
||||||
char *why2_strdup(char *string)
|
char *why2_strdup(char *string)
|
||||||
{
|
{
|
||||||
|
if (string == NULL) return NULL;
|
||||||
|
|
||||||
char *allocated = strdup(string);
|
char *allocated = strdup(string);
|
||||||
|
|
||||||
push_to_list(allocated, ALLOCATION);
|
push_to_list(allocated, ALLOCATION);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user