ctor: Set pointers to NULL before allocation.

This way, the dtor can work correctly.
This commit is contained in:
Jonathan Schleifer 2012-04-21 17:21:55 +02:00
parent 0ed91e92d1
commit 63b6165a91

View file

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