diff options
author | Thomas Graf <tgr@lsx.localdomain> | 2008-04-29 20:58:07 (GMT) |
---|---|---|
committer | Thomas Graf <tgr@lsx.localdomain> | 2008-04-29 20:58:07 (GMT) |
commit | f4f7704b0d119ddf9672d81b1d7f76347dbf7a1f (patch) | |
tree | c6256f59cd52569f3a436ca0b334abec93affd17 /lib/cache.c | |
parent | 22f0ece5acc0d1cbe556c1dd2a11bb42d27cab0c (diff) | |
download | libnl-f4f7704b0d119ddf9672d81b1d7f76347dbf7a1f.zip libnl-f4f7704b0d119ddf9672d81b1d7f76347dbf7a1f.tar.gz libnl-f4f7704b0d119ddf9672d81b1d7f76347dbf7a1f.tar.bz2 |
Ignore NULL pointers passed to nl_cache_free()
Diffstat (limited to 'lib/cache.c')
-rw-r--r-- | lib/cache.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |