From a464ef5069efe62074a5b4d6af8e3e831bc52bd0 Mon Sep 17 00:00:00 2001 From: LAN-TW Date: Sun, 8 Dec 2013 00:06:15 +0800 Subject: Check NULL pointer before unref --- l4array2.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'l4array2.c') diff --git a/l4array2.c b/l4array2.c index d1f1b99..f066cf4 100644 --- a/l4array2.c +++ b/l4array2.c @@ -37,6 +37,9 @@ void* lbs_array2_ref_generic (void* array2_generic) { } void lbs_array2_unref_generic (void* array2_generic) { + if (array2_generic == NULL) { + return; + } LbsArray2* array2 = LBS_ARRAY2 (array2_generic); array2->ref_count--; if (array2->ref_count <= 0) { -- cgit v1.2.3