Explorar o código

fix error in null checkings (#810)

fixes #802 and #803
Lee %!s(int64=2) %!d(string=hai) anos
pai
achega
e232ffa3c0
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      cJSON.c

+ 1 - 1
cJSON.c

@@ -2280,7 +2280,7 @@ CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON
         return add_item_to_array(array, newitem);
     }
 
-    if (after_inserted != array->child && newitem->prev == NULL) {
+    if (after_inserted != array->child && after_inserted->prev == NULL) {
         /* return false if after_inserted is a corrupted array item */
         return false;
     }