From 05ef68a4c4f87673ff6787a491cc7461f9ddb9e1 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 4 Jun 2008 18:14:08 +0200 Subject: [PATCH] [refcount] Check for pointer existence Signed-off-by: Julien Danjou --- common/refcount.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/refcount.h b/common/refcount.h index 1eb56c79..18f4b109 100644 --- a/common/refcount.h +++ b/common/refcount.h @@ -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); \ } \ \