mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 08:05:37 +00:00
oops fix this the right way - json malloc and free
This commit is contained in:
parent
091952cab7
commit
4ae090ffd9
@ -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);
|
return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *(*cJSON_malloc)(size_t sz);
|
static void *glue_malloc(size_t theSize)
|
||||||
static void (*cJSON_free)(void *ptr);
|
{
|
||||||
|
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)
|
static char* cJSON_strdup(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -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);
|
return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *(*cJSON_malloc)(size_t sz);
|
static void *glue_malloc(size_t theSize)
|
||||||
static void (*cJSON_free)(void *ptr);
|
{
|
||||||
|
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)
|
static char* cJSON_strdup(const char* str)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user