patch-json_object_c 705 B

1234567891011121314151617
  1. Fix for gcc-14
  2. Upstream did not just fix this, but delay (the implicit) memset() in
  3. commit 4a546e7b2f471 ("In arraylist, use malloc instead of calloc,
  4. avoid clearing with memeset until we really need to, and micro-optimize
  5. array_list_add().") which is not suitable for a backport.
  6. --- json-c-0.13.orig/json_object.c 2017-12-05 05:44:03.000000000 +0100
  7. +++ json-c-0.13/json_object.c 2025-01-08 02:21:42.515180709 +0100
  8. @@ -218,7 +218,7 @@ static struct json_object* json_object_n
  9. {
  10. struct json_object *jso;
  11. - jso = (struct json_object*)calloc(sizeof(struct json_object), 1);
  12. + jso = (struct json_object*)calloc(1, sizeof(struct json_object));
  13. if (!jso)
  14. return NULL;
  15. jso->o_type = o_type;