RNCFG: protect deletion of configs
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 8 Jun 2013 15:10:06 +0000 (17:10 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 8 Jun 2013 15:10:06 +0000 (17:10 +0200)
citadel/netconfig.c

index f09c852..9e3fdc9 100644 (file)
@@ -1172,9 +1172,12 @@ int CtdlIsValidNode(const StrBuf **nexthop,
 void destroy_network_cfgs(void)
 {
        HashList *pCfgTypeHash = CfgTypeHash;
-       HashList *pRoomConfigs = RoomConfigs;
+       HashList *pRoomConfigs;
 
+       begin_critical_section(S_NETCONFIGS);
+       pRoomConfigs = RoomConfigs;
        RoomConfigs = NULL;
+       end_critical_section(S_NETCONFIGS);
        DeleteHash(&pRoomConfigs);
 
        CfgTypeHash = NULL;