Siteconfig: fix memleak in case of error.
authorWilfried Goesgens <dothebart@citadel.org>
Wed, 8 Feb 2012 18:58:22 +0000 (19:58 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Wed, 8 Feb 2012 18:58:22 +0000 (19:58 +0100)
webcit/siteconfig.c

index a2b429806693a45a76487195317ae8c1f4077275..4038bd03fd0a02cdd61a241cd8dce0ef642a7612 100644 (file)
@@ -224,6 +224,7 @@ void load_siteconfig(void)
        if (GetServerStatus(Buf, NULL) != 1) {
                StrBufCutLeft(Buf, 4);
                AppendImportantMessage(SKEY(Buf));
+               FreeStrBuf(&Buf);
                return;
                
        }
@@ -250,6 +251,7 @@ void load_siteconfig(void)
                while ((len = StrBuf_ServGetln(Buf),
                        strcmp(ChrPtr(Buf), "000"))) {}
                AppendImportantMessage(_("WARNING: Failed to parse Server Config; do you run a to new citserver?"), -1);
+               FreeStrBuf(&Buf);
                return;
        }
        FreeStrBuf(&Buf);