RNCFG: protect deletion of configs
[citadel.git] / 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;