summaryrefslogtreecommitdiff
path: root/main/astobj2.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/astobj2.c')
-rw-r--r--main/astobj2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index 48fae0a9d..40efd0f2a 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -262,6 +262,9 @@ static int internal_ao2_ref(void *user_data, const int delta)
int current_value;
int ret;
+ if (obj == NULL)
+ return -1;
+
/* if delta is 0, just return the refcount */
if (delta == 0)
return (obj->priv_data.ref_counter);
@@ -499,7 +502,7 @@ static struct bucket_list *internal_ao2_link(struct ao2_container *c, void *user
struct bucket_list *p;
struct astobj2 *obj = INTERNAL_OBJ(user_data);
- if (!obj)
+ if (obj == NULL)
return NULL;
if (INTERNAL_OBJ(c) == NULL)