]> granicus.if.org Git - libnl/commitdiff
Ignore NULL pointers passed to nl_cache_free()
authorThomas Graf <tgr@lsx.localdomain>
Tue, 29 Apr 2008 20:58:07 +0000 (22:58 +0200)
committerThomas Graf <tgr@lsx.localdomain>
Tue, 29 Apr 2008 20:58:07 +0000 (22:58 +0200)
lib/cache.c

index 285bc316e6a65b2b928c893728d14237f5df55f4..e7ba5b92b477d3088b8838886a6ead8c449f7775 100644 (file)
@@ -264,6 +264,9 @@ void nl_cache_clear(struct nl_cache *cache)
  */
 void nl_cache_free(struct nl_cache *cache)
 {
+       if (!cache)
+               return;
+
        nl_cache_clear(cache);
        NL_DBG(1, "Freeing cache %p <%s>...\n", cache, nl_cache_name(cache));
        free(cache);