From: Thomas Graf Date: Sat, 21 Apr 2012 13:51:43 +0000 (+0200) Subject: cache_mngr: Make providing the result pointer to nl_cache_mngr_add() optional X-Git-Tag: libnl3_2_8~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e93940a86cc78228e8c0b1b7f469d817c6dc178;p=libnl cache_mngr: Make providing the result pointer to nl_cache_mngr_add() optional --- diff --git a/lib/cache_mngr.c b/lib/cache_mngr.c index 15b545d..39cf0ac 100644 --- a/lib/cache_mngr.c +++ b/lib/cache_mngr.c @@ -169,7 +169,7 @@ errout: * @arg name Name of cache to keep track of * @arg cb Function to be called upon changes. * @arg data Argument passed on to change callback - * @arg result Pointer to store added cache. + * @arg result Pointer to store added cache (optional) * * Allocates a new cache of the specified type and adds it to the manager. * The operation will trigger a full dump request from the kernel to @@ -259,7 +259,8 @@ retry: NL_DBG(1, "Added cache %p <%s> to cache manager %p\n", cache, nl_cache_name(cache), mngr); - *result = cache; + if (result) + *result = cache; return 0; errout_drop_membership: