From: Thomas Graf Date: Tue, 29 Apr 2008 20:58:07 +0000 (+0200) Subject: Ignore NULL pointers passed to nl_cache_free() X-Git-Tag: libnl2_0~127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4f7704b0d119ddf9672d81b1d7f76347dbf7a1f;p=libnl Ignore NULL pointers passed to nl_cache_free() --- diff --git a/lib/cache.c b/lib/cache.c index 285bc31..e7ba5b9 100644 --- a/lib/cache.c +++ b/lib/cache.c @@ -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);