Wildfire: fix memory leak.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 31 Mar 2013 19:54:38 +0000 (21:54 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 31 Mar 2013 19:54:38 +0000 (21:54 +0200)
libcitadel/lib/wildfire.c

index ff4e20f..1958f59 100644 (file)
@@ -373,7 +373,8 @@ void WildFireSerializePayload(StrBuf *JsonBuffer, StrBuf *OutBuf, int *MsgCount,
        const char *Cat;
        StrBuf *Header;
 
-       Header = NewStrBuf();
+       if (OutBuf == NULL)
+               Header = NewStrBuf();
        if (*MsgCount == 0) {
                if (OutBuf != NULL) {
                        StrBufAppendBufPlain(OutBuf,