platform: add NULL check in inline nmp_object_unref() function
This allows the compiler to see that this function does nothing for %NULL. That is not so unusual, as we use nm_auto_nmpobj to free objects. Often the compiler can see that these pointers are %NULL.
This commit is contained in:
@@ -632,9 +632,11 @@ nmp_object_ref (const NMPObject *obj)
|
||||
static inline void
|
||||
nmp_object_unref (const NMPObject *obj)
|
||||
{
|
||||
nm_assert (!obj || NMP_OBJECT_IS_VALID (obj));
|
||||
if (obj) {
|
||||
nm_assert (NMP_OBJECT_IS_VALID (obj));
|
||||
|
||||
nm_dedup_multi_obj_unref ((const NMDedupMultiObj *) obj);
|
||||
}
|
||||
}
|
||||
|
||||
#define nm_clear_nmp_object(ptr) \
|
||||
|
Reference in New Issue
Block a user