From 08be94e8e6370ce9ac75fad77db3598a96e58805 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Tue, 15 Oct 2013 08:46:16 +0300 Subject: [PATCH] Don't call strlen twice Oops. --- src/hashtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hashtable.c b/src/hashtable.c index 0af8cee..83ac856 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -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;