lib: reorder free() after printf("%p") statements

Previously coverity was complaining about a use-after-free.
This was not a real problem, because the printf statement
does not dereferenciate the pointer. Change it to avoid
the warning.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-06-10 17:53:37 +02:00
parent bb44548b92
commit 29a38942aa
4 changed files with 7 additions and 5 deletions

View file

@ -515,9 +515,10 @@ void nl_cache_mngr_free(struct nl_cache_mngr *mngr)
}
free(mngr->cm_assocs);
free(mngr);
NL_DBG(1, "Cache manager %p freed\n", mngr);
free(mngr);
}
/** @} */

View file

@ -569,8 +569,8 @@ void nlmsg_free(struct nl_msg *msg)
if (msg->nm_refcnt <= 0) {
free(msg->nm_nlh);
free(msg);
NL_DBG(2, "msg %p: Freed\n", msg);
free(msg);
}
}

View file

@ -185,9 +185,9 @@ void nl_object_free(struct nl_object *obj)
if (ops->oo_free_data)
ops->oo_free_data(obj);
free(obj);
NL_DBG(4, "Freed object %p\n", obj);
free(obj);
}
/** @} */

View file

@ -282,9 +282,10 @@ void rtnl_ematch_tree_free(struct rtnl_ematch_tree *tree)
return;
free_ematch_list(&tree->et_list);
free(tree);
NL_DBG(2, "Freed ematch tree %p\n", tree);
free(tree);
}
/**