mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-13 07:45:26 +00:00
FS-10036: add back in patch from FS-4285. Still need to address this upstream
This commit is contained in:
parent
53aab765d8
commit
e4e4fd2f9f
@ -92,18 +92,14 @@ static unsigned char* cJSON_strdup(const unsigned char* str, const internal_hook
|
||||
{
|
||||
size_t len = 0;
|
||||
unsigned char *copy = NULL;
|
||||
const unsigned char *s = str ? str : (unsigned char *)"";
|
||||
|
||||
if (str == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
len = strlen((const char*)str) + 1;
|
||||
len = strlen((const char*)s) + 1;
|
||||
if (!(copy = (unsigned char*)hooks->allocate(len)))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
memcpy(copy, str, len);
|
||||
memcpy(copy, s, len);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
@ -92,18 +92,14 @@ static unsigned char* cJSON_strdup(const unsigned char* str, const internal_hook
|
||||
{
|
||||
size_t len = 0;
|
||||
unsigned char *copy = NULL;
|
||||
const unsigned char *s = str ? str : (unsigned char *)"";
|
||||
|
||||
if (str == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
len = strlen((const char*)str) + 1;
|
||||
len = strlen((const char*)s) + 1;
|
||||
if (!(copy = (unsigned char*)hooks->allocate(len)))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
memcpy(copy, str, len);
|
||||
memcpy(copy, s, len);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
10
src/cJSON.c
10
src/cJSON.c
@ -92,18 +92,14 @@ static unsigned char* cJSON_strdup(const unsigned char* str, const internal_hook
|
||||
{
|
||||
size_t len = 0;
|
||||
unsigned char *copy = NULL;
|
||||
const unsigned char *s = str ? str : (unsigned char *)"";
|
||||
|
||||
if (str == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
len = strlen((const char*)str) + 1;
|
||||
len = strlen((const char*)s) + 1;
|
||||
if (!(copy = (unsigned char*)hooks->allocate(len)))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
memcpy(copy, str, len);
|
||||
memcpy(copy, s, len);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user