aboutsummaryrefslogtreecommitdiffstats
path: root/l4array2.c
diff options
context:
space:
mode:
authorLAN-TW <lantw44@gmail.com>2013-12-08 00:06:15 +0800
committerLAN-TW <lantw44@gmail.com>2013-12-08 00:06:15 +0800
commita464ef5069efe62074a5b4d6af8e3e831bc52bd0 (patch)
tree2c646fcf2e988ec26f16905b58e03eef76a9a1e7 /l4array2.c
parent06159197d374e33d37aaaaed2b8b603cd65a270d (diff)
downloadl4basic-a464ef5069efe62074a5b4d6af8e3e831bc52bd0.tar
l4basic-a464ef5069efe62074a5b4d6af8e3e831bc52bd0.tar.gz
l4basic-a464ef5069efe62074a5b4d6af8e3e831bc52bd0.tar.bz2
l4basic-a464ef5069efe62074a5b4d6af8e3e831bc52bd0.tar.lz
l4basic-a464ef5069efe62074a5b4d6af8e3e831bc52bd0.tar.xz
l4basic-a464ef5069efe62074a5b4d6af8e3e831bc52bd0.tar.zst
l4basic-a464ef5069efe62074a5b4d6af8e3e831bc52bd0.zip
Check NULL pointer before unref
Diffstat (limited to 'l4array2.c')
-rw-r--r--l4array2.c3
1 files changed, 3 insertions, 0 deletions
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) {