summaryrefslogtreecommitdiffstats
path: root/src/oplist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/oplist.c')
-rw-r--r--src/oplist.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/oplist.c b/src/oplist.c
index deb54de..168c921 100644
--- a/src/oplist.c
+++ b/src/oplist.c
@@ -560,11 +560,9 @@ static void parse_dict_data(parse_ctx ctx, plist_t dict)
560 val = NULL; 560 val = NULL;
561 ctx->err = node_from_openstep(ctx, &val); 561 ctx->err = node_from_openstep(ctx, &val);
562 if (ctx->err != 0) { 562 if (ctx->err != 0) {
563 plist_free(key);
564 break; 563 break;
565 } 564 }
566 if (!val) { 565 if (!val) {
567 plist_free(key);
568 PLIST_OSTEP_ERR("Missing value for dictionary item at offset %ld\n", ctx->pos - ctx->start); 566 PLIST_OSTEP_ERR("Missing value for dictionary item at offset %ld\n", ctx->pos - ctx->start);
569 ctx->err++; 567 ctx->err++;
570 break; 568 break;
@@ -576,8 +574,6 @@ static void parse_dict_data(parse_ctx ctx, plist_t dict)
576 break; 574 break;
577 } 575 }
578 if (*ctx->pos != ';') { 576 if (*ctx->pos != ';') {
579 plist_free(val);
580 plist_free(key);
581 PLIST_OSTEP_ERR("Missing terminating ';' while parsing dictionary item at offset %ld\n", ctx->pos - ctx->start); 577 PLIST_OSTEP_ERR("Missing terminating ';' while parsing dictionary item at offset %ld\n", ctx->pos - ctx->start);
582 ctx->err++; 578 ctx->err++;
583 break; 579 break;
@@ -585,10 +581,13 @@ static void parse_dict_data(parse_ctx ctx, plist_t dict)
585 581
586 plist_dict_set_item(dict, plist_get_string_ptr(key, NULL), val); 582 plist_dict_set_item(dict, plist_get_string_ptr(key, NULL), val);
587 plist_free(key); 583 plist_free(key);
584 key = NULL;
588 val = NULL; 585 val = NULL;
589 586
590 ctx->pos++; 587 ctx->pos++;
591 } 588 }
589 plist_free(key);
590 plist_free(val);
592} 591}
593 592
594static int node_from_openstep(parse_ctx ctx, plist_t *plist) 593static int node_from_openstep(parse_ctx ctx, plist_t *plist)
@@ -654,6 +653,8 @@ static int node_from_openstep(parse_ctx ctx, plist_t *plist)
654 } 653 }
655 ctx->pos++; 654 ctx->pos++;
656 } 655 }
656 plist_free(tmp);
657 tmp = NULL;
657 if (ctx->err) { 658 if (ctx->err) {
658 goto err_out; 659 goto err_out;
659 } 660 }