From f6b8e0eae4374f339487a33e3e4fe5462d5816e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 25 Nov 2017 10:16:00 +0100 Subject: New upstream version 2.0.0 --- jcnf/jcnf.c | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 jcnf/jcnf.c (limited to 'jcnf/jcnf.c') diff --git a/jcnf/jcnf.c b/jcnf/jcnf.c old mode 100644 new mode 100755 index 799be7c..273796e --- a/jcnf/jcnf.c +++ b/jcnf/jcnf.c @@ -413,6 +413,7 @@ static jc_error jcnf_delete_key( if ((ix+1) < p->nkeys) { memmove(p->keys+ix, p->keys+ix+1,sizeof(jc_key *) * p->nkeys-ix-1); } + free(p->keys[p->nkeys-1]); p->nkeys--; p->modified = 1; @@ -607,6 +608,7 @@ static int jcnf_yajl_start_map(void *ctx) { return 1; } +/* Callback from yajl */ static int jcnf_yajl_map_key(void *ctx, const unsigned char * stringVal, size_t stringLen) { jcnf *p = (jcnf *)ctx; @@ -650,6 +652,8 @@ static int jcnf_yajl_end_map(void *ctx) { /* End of map without start of map */ return 0; } + if (p->recds[p->nrecd-1].key != NULL) + free(p->recds[p->nrecd-1].key); p->nrecd--; #ifdef NEVER -- cgit v1.2.3