Siteconfig: fix memleak in case of error.
[citadel.git] / webcit / siteconfig.c
index a5af547832212fee99e583ee8f19b0a5ae82266c..4038bd03fd0a02cdd61a241cd8dce0ef642a7612 100644 (file)
@@ -35,8 +35,7 @@ void LoadExpirePolicy(GPEXWhichPolicy which)
                WCC->Policy[which].expire_value = StrBufExtractNext_long(Buf, &Pos, '|');
        }
        else if (State == 550)
-               StrBufAppendBufPlain(WCC->ImportantMsg,
-                                    _("Higher access is required to access this function."), -1, 0);
+               AppendImportantMessage(_("Higher access is required to access this function."), -1);
        FreeStrBuf(&Buf);
 }
 
@@ -54,8 +53,7 @@ void SaveExpirePolicyFromHTTP(GPEXWhichPolicy which)
        StrBuf_ServGetln(Buf);
        GetServerStatus(Buf, &State);
        if (State == 550)
-               StrBufAppendBufPlain(WC->ImportantMsg,
-                                    _("Higher access is required to access this function."), -1, 0);
+               AppendImportantMessage(_("Higher access is required to access this function."), -1);
        FreeStrBuf(&Buf);
 }
 
@@ -226,6 +224,7 @@ void load_siteconfig(void)
        if (GetServerStatus(Buf, NULL) != 1) {
                StrBufCutLeft(Buf, 4);
                AppendImportantMessage(SKEY(Buf));
+               FreeStrBuf(&Buf);
                return;
                
        }
@@ -252,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);