Don't call strlen twice
Oops.
This commit is contained in:
parent
d544852ff6
commit
08be94e8e6
@ -256,7 +256,7 @@ int hashtable_set(hashtable_t *hashtable,
|
||||
return -1;
|
||||
}
|
||||
|
||||
pair = jsonp_malloc(offsetof(pair_t, key) + strlen(key) + 1);
|
||||
pair = jsonp_malloc(offsetof(pair_t, key) + len + 1);
|
||||
if(!pair)
|
||||
return -1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user