X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fnetconfig.c;h=916835e53465f53f98b6f281674197ce1067e4ad;hb=4fe4a42959a6634f59cf6f45c58a07da5b29cd45;hp=0f89d4474aa3468ed0ef0919a94f52a0232d8afa;hpb=871eb54b83a35ef859427ea82b07ef3d70f861f2;p=citadel.git diff --git a/citadel/netconfig.c b/citadel/netconfig.c index 0f89d4474..916835e53 100644 --- a/citadel/netconfig.c +++ b/citadel/netconfig.c @@ -165,7 +165,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 +173,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));