summaryrefslogtreecommitdiff
path: root/jcnf/jcnf.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-11-25 10:16:54 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-11-25 10:16:54 +0100
commit1b1126bd023a2bb92699773a1867358067dabcb8 (patch)
tree6fd56d034e5a154c7992e7855d61691cecd043c4 /jcnf/jcnf.c
parentcb5c7cec4aa1946f75dc3d408eb7f1051f3fb3d4 (diff)
parentf6b8e0eae4374f339487a33e3e4fe5462d5816e1 (diff)
Update upstream source from tag 'upstream/2.0.0'
Update to upstream version '2.0.0' with Debian dir e866e6e75661017faaa5331becda76021407390b
Diffstat (limited to 'jcnf/jcnf.c')
-rwxr-xr-x[-rw-r--r--]jcnf/jcnf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/jcnf/jcnf.c b/jcnf/jcnf.c
index 799be7c..273796e 100644..100755
--- 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