Properly detect stream pointers to avaid crashes on freeing.`
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 18 Jan 2015 14:31:44 +0000 (15:31 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 18 Jan 2015 14:31:44 +0000 (15:31 +0100)
libcitadel/lib/stringbuf.c

index 7b2c663656e08fd874d788250c80a5333acd2877..5cbe17fdb560b003b3e3d25136e2ac73497e3da6 100644 (file)
@@ -2931,7 +2931,7 @@ void *StrBufNewStreamContext(eStreamType type)
 
 void StrBufDestroyStreamContext(eStreamType type, void **vStream)
 {
-       if (*vStream) {
+       if ((vStream == NULL) || (*vStream==NULL)) {
                return;
        }
        switch (type)