]> code.citadel.org Git - citadel.git/blobdiff - webcit/netconf.c
fix various incidents reported by CLANG Static analyzer:
[citadel.git] / webcit / netconf.c
index f3908d3e1c0bb9b90c88463b2b16828154d3c94f..d08c42db3d60563fd56c50b6035c7a72be2e116f 100644 (file)
@@ -97,8 +97,8 @@ HashList *load_netconf(StrBuf *Target, WCTemplputParams *TP)
                Hash = NewHash(1, NULL);
 
                Buf = NewStrBuf();
-               while ((len = StrBuf_ServGetln(Buf),
-                       strcmp(ChrPtr(Buf), "000"))) {
+               while ((len = StrBuf_ServGetln(Buf), (len >= 0) && 
+                       ((len != 3) || !strcmp(ChrPtr(Buf), "000")))) {
                        Node = NewNode(Buf);
                        if (Node == NULL)
                                continue;
@@ -138,6 +138,7 @@ void save_net_conf(HashList *Nodelist)
                                }
                        }
                        FreeStrBuf(&Buf);
+                       DeleteHashPos(&where);
                }
                serv_puts("000");
        }