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 f09c852fd32a3786ac5cc1f15c35c4e6fcbde087..9e3fdc9cb84265f29908c3b072811c4246181d93 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;