mirror of
https://github.com/akheron/jansson.git
synced 2025-04-06 05:55:05 +00:00
parent
8490e377c0
commit
11d45b0090
1 changed files with 6 additions and 1 deletions
|
@ -35,8 +35,13 @@ void jsonp_free(void *ptr)
|
|||
char *jsonp_strdup(const char *str)
|
||||
{
|
||||
char *new_str;
|
||||
size_t len;
|
||||
|
||||
new_str = jsonp_malloc(strlen(str) + 1);
|
||||
len = strlen(str);
|
||||
if(len == (size_t)-1)
|
||||
return NULL;
|
||||
|
||||
new_str = jsonp_malloc(len + 1);
|
||||
if(!new_str)
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue