From 63b6165a9187fd4c5074f113c4c561ffb4f3ade3 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sat, 21 Apr 2012 17:21:55 +0200 Subject: [PATCH] ctor: Set pointers to NULL before allocation. This way, the dtor can work correctly. --- src/string.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/string.c b/src/string.c index 4d90680..55db71c 100644 --- a/src/string.c +++ b/src/string.c @@ -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;