ctor: Set pointers to NULL before allocation.
This way, the dtor can work correctly.
This commit is contained in:
parent
0ed91e92d1
commit
63b6165a91
1 changed files with 1 additions and 0 deletions
|
@ -45,6 +45,7 @@ ctor(void *ptr, va_list args)
|
|||
const char *cstr = va_arg(args, const char*);
|
||||
|
||||
if (cstr != NULL) {
|
||||
str->data = NULL;
|
||||
if ((str->data = strdup(cstr)) == NULL)
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue