Hold reference to obj while calling callback of cache iterator

This commit is contained in:
Thomas Graf 2011-03-17 17:30:32 +01:00
parent 33e94038c4
commit 552c85cab7

View file

@ -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);
}
}