skipping strdup on NULL string param

This commit is contained in:
Václav Šmejkal 2025-01-31 12:37:08 +01:00
parent 4649b7ccf6
commit ea018644f2
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -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);