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 7b2c663..5cbe17f 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)