From 4ae090ffd964b02545bd9c87ec886671a73af1a4 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Thu, 17 Jun 2010 14:17:15 -0500 Subject: [PATCH] oops fix this the right way - json malloc and free --- libs/esl/src/esl_json.c | 14 ++++++++++++-- src/switch_json.c | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/libs/esl/src/esl_json.c b/libs/esl/src/esl_json.c index 449c31e92b..813040480a 100644 --- a/libs/esl/src/esl_json.c +++ b/libs/esl/src/esl_json.c @@ -33,8 +33,18 @@ static int cJSON_strcasecmp(const char *s1,const char *s2) return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2); } -static void *(*cJSON_malloc)(size_t sz); -static void (*cJSON_free)(void *ptr); +static void *glue_malloc(size_t theSize) +{ + return(malloc(theSize)); +} + +static void glue_free(void *thePtr) +{ + free(thePtr); +} + +static void *(*cJSON_malloc)(size_t sz) = glue_malloc; +static void (*cJSON_free)(void *ptr) = glue_free; static char* cJSON_strdup(const char* str) { diff --git a/src/switch_json.c b/src/switch_json.c index fb78a154fa..c07dfa8712 100644 --- a/src/switch_json.c +++ b/src/switch_json.c @@ -33,8 +33,18 @@ static int cJSON_strcasecmp(const char *s1,const char *s2) return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2); } -static void *(*cJSON_malloc)(size_t sz); -static void (*cJSON_free)(void *ptr); +static void *glue_malloc(size_t theSize) +{ + return(malloc(theSize)); +} + +static void glue_free(void *thePtr) +{ + free(thePtr); +} + +static void *(*cJSON_malloc)(size_t sz) = glue_malloc; +static void (*cJSON_free)(void *ptr) = glue_free; static char* cJSON_strdup(const char* str) {