dect
/
libnl
Archived
13
0
Fork 0

Perform no operation on nl_object_free(NULL).

Passing a NULL pointer would cause a NULL pointer dereference within
nl_object_free().
Returning early on NULL pointer is the behavior free(3) and other
nl*_free() functions.

Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com>
This commit is contained in:
Emmanuel Roullit 2013-04-03 21:07:32 +02:00
parent 56eb22fa74
commit ea436445ad
1 changed files with 6 additions and 1 deletions

View File

@ -165,7 +165,12 @@ int nl_object_update(struct nl_object *dst, struct nl_object *src)
*/
void nl_object_free(struct nl_object *obj)
{
struct nl_object_ops *ops = obj_ops(obj);
struct nl_object_ops *ops;
if (!obj)
return;
ops = obj_ops(obj);
if (obj->ce_refcnt > 0)
NL_DBG(1, "Warning: Freeing object in use...\n");