]> code.citadel.org Git - citadel.git/blobdiff - citadel/netconfig.c
RNCFG: add forward declaration missing in last commit.
[citadel.git] / citadel / netconfig.c
index 0f89d4474aa3468ed0ef0919a94f52a0232d8afa..7fc53c594c8df304a055847f938e6de65c723f8b 100644 (file)
@@ -32,6 +32,7 @@
 
 
 void vFreeRoomNetworkStruct(void *vOneRoomNetCfg);
+void FreeRoomNetworkStructContent(OneRoomNetCfg *OneRNCfg);
 
 HashList *CfgTypeHash = NULL;
 HashList *RoomConfigs = NULL;
@@ -165,7 +166,7 @@ int ReadRoomNetConfigFile(OneRoomNetCfg **pOneRNCfg, char *filename)
        const CfgLineType *pCfg;
        StrBuf *Line;
        StrBuf *InStr;
-       OneRoomNetCfg *OneRNCfg;
+       OneRoomNetCfg *OneRNCfg = NULL;
 
        fd = open(filename, O_NONBLOCK|O_RDONLY);
        if (fd == -1) {
@@ -173,7 +174,10 @@ int ReadRoomNetConfigFile(OneRoomNetCfg **pOneRNCfg, char *filename)
                return 0;
        }
        if (*pOneRNCfg != NULL)
+       {
                OneRNCfg = *pOneRNCfg;
+               FreeRoomNetworkStructContent (OneRNCfg);
+       }
        else
                OneRNCfg = malloc(sizeof(OneRoomNetCfg));
        memset(OneRNCfg, 0, sizeof(OneRoomNetCfg));