From: Matthieu Moy Date: Thu, 26 Jun 2014 16:27:10 GMT Subject: Re: [PATCH v3 2/3] config: add hashtable for config parsing & retrieval Message-ID: In-Reply-To: <53A96D2D.1020102@gmail.com> Tanay Abhra writes: > For the config_cache_free(), would this change be enough? > > +static void config_cache_free(void) > +{ > + struct hashmap *config_cache; > + struct config_cache_entry *entry; > + struct hashmap_iter iter; > + if (!hashmap_initialized) > + return; > + config_cache = get_config_cache(); That sounds better to me. And it justifies the different scopes: one can ask whether the map is initialized from anywhere in the file, but can only get the map after initialization, so it prevents mis-use of an uninitialized pointer. -- Matthieu Moy http://www-verimag.imag.fr/~moy/