diff options
author | Thomas Graf <tgraf@suug.ch> | 2011-03-17 16:30:32 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2011-03-17 16:30:32 (GMT) |
commit | 552c85cab787fde0aeb68b50eb56690e7652710c (patch) | |
tree | baec5561a8a06a4e685b330a1a0bdf10e51b4dc1 /lib | |
parent | 33e94038c45aec39024c7e47441c6b25b7a11a9b (diff) | |
download | libnl-552c85cab787fde0aeb68b50eb56690e7652710c.zip libnl-552c85cab787fde0aeb68b50eb56690e7652710c.tar.gz libnl-552c85cab787fde0aeb68b50eb56690e7652710c.tar.bz2 |
Hold reference to obj while calling callback of cache iterator
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cache.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/cache.c b/lib/cache.c index e0e845d..601dadc 100644 --- a/lib/cache.c +++ b/lib/cache.c @@ -834,7 +834,12 @@ void nl_cache_foreach_filter(struct nl_cache *cache, struct nl_object *filter, continue; } + /* Caller may hold obj for a long time */ + nl_object_get(obj); + cb(obj, arg); + + nl_object_put(obj); } } |