diff options
author | Thomas Graf <tgraf@suug.ch> | 2012-11-15 23:20:18 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2012-11-15 23:29:58 (GMT) |
commit | cb82c2a5451a52e7365957a2325258af1b179aee (patch) | |
tree | 2f166ab92205d745534500d525fb6e07ab3213c9 /lib/object.c | |
parent | 2b3912a320ef74b31d84380d91ec036dbf1b9f52 (diff) | |
download | libnl-cb82c2a5451a52e7365957a2325258af1b179aee.zip libnl-cb82c2a5451a52e7365957a2325258af1b179aee.tar.gz libnl-cb82c2a5451a52e7365957a2325258af1b179aee.tar.bz2 |
use safe cache lookup variants internally
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'lib/object.c')
-rw-r--r-- | lib/object.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/object.c b/lib/object.c index 024062e..806bae6 100644 --- a/lib/object.c +++ b/lib/object.c @@ -85,11 +85,13 @@ int nl_object_alloc_name(const char *kind, struct nl_object **result) { struct nl_cache_ops *ops; - ops = nl_cache_ops_lookup(kind); + ops = nl_cache_ops_lookup_safe(kind); if (!ops) return -NLE_OPNOTSUPP; - if (!(*result = nl_object_alloc(ops->co_obj_ops))) + *result = nl_object_alloc(ops->co_obj_ops); + nl_cache_ops_put(ops); + if (!*result) return -NLE_NOMEM; return 0; |