mirror of
https://github.com/akheron/jansson.git
synced 2025-04-06 05:55:05 +00:00
Fix a few malloc() and free() calls
Replace them with jsonp_malloc() and jsonp_free() to support the custom memory allocation.
This commit is contained in:
parent
0944ac8d91
commit
eab23f05d8
2 changed files with 3 additions and 3 deletions
|
@ -126,7 +126,7 @@ static int hashtable_do_del(hashtable_t *hashtable,
|
|||
if(hashtable->free_value)
|
||||
hashtable->free_value(pair->value);
|
||||
|
||||
free(pair);
|
||||
jsonp_free(pair);
|
||||
hashtable->size--;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -19,7 +19,7 @@ int strbuffer_init(strbuffer_t *strbuff)
|
|||
strbuff->size = STRBUFFER_MIN_SIZE;
|
||||
strbuff->length = 0;
|
||||
|
||||
strbuff->value = malloc(strbuff->size);
|
||||
strbuff->value = jsonp_malloc(strbuff->size);
|
||||
if(!strbuff->value)
|
||||
return -1;
|
||||
|
||||
|
@ -30,7 +30,7 @@ int strbuffer_init(strbuffer_t *strbuff)
|
|||
|
||||
void strbuffer_close(strbuffer_t *strbuff)
|
||||
{
|
||||
free(strbuff->value);
|
||||
jsonp_free(strbuff->value);
|
||||
strbuff->size = 0;
|
||||
strbuff->length = 0;
|
||||
strbuff->value = NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue