[refcount] Check for pointer existence

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-04 18:14:08 +02:00
parent eb8378749b
commit 05ef68a4c4
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@
#define DO_RCNT(type, prefix, dtor) \
static inline void prefix##_unref(type **item) \
{ \
if(--(*item)->refcount <= 0) \
if(*item && --(*item)->refcount <= 0) \
dtor(item); \
} \
\