diff --git a/c/containers/lhms2v.c b/c/containers/lhms2v.c index 0297f743c..a95cc90df 100644 --- a/c/containers/lhms2v.c +++ b/c/containers/lhms2v.c @@ -85,6 +85,7 @@ void lhms2v_free(lhms2v_t* pmap) { if (pmap == NULL) return; free(pmap->entries); + free(pmap->states); pmap->entries = NULL; pmap->num_occupied = 0; pmap->num_freed = 0; diff --git a/c/containers/lhmsi.c b/c/containers/lhmsi.c index ffb752cc8..1d64b9c6e 100644 --- a/c/containers/lhmsi.c +++ b/c/containers/lhmsi.c @@ -88,6 +88,7 @@ void lhmsi_free(lhmsi_t* pmap) { free(pe->key); } free(pmap->entries); + free(pmap->states); pmap->entries = NULL; pmap->num_occupied = 0; pmap->num_freed = 0; diff --git a/c/containers/lhmslv.c b/c/containers/lhmslv.c index 442b29c57..a55513818 100644 --- a/c/containers/lhmslv.c +++ b/c/containers/lhmslv.c @@ -87,6 +87,7 @@ void lhmslv_free(lhmslv_t* pmap) { for (lhmslve_t* pe = pmap->phead; pe != NULL; pe = pe->pnext) slls_free(pe->key); free(pmap->entries); + free(pmap->states); pmap->entries = NULL; pmap->num_occupied = 0; pmap->num_freed = 0; diff --git a/c/containers/lhmss.c b/c/containers/lhmss.c index 657f67366..f672b2b99 100644 --- a/c/containers/lhmss.c +++ b/c/containers/lhmss.c @@ -88,6 +88,7 @@ void lhmss_free(lhmss_t* pmap) { free(pe->value); } free(pmap->entries); + free(pmap->states); pmap->entries = NULL; pmap->num_occupied = 0; pmap->num_freed = 0; diff --git a/c/containers/lhmsv.c b/c/containers/lhmsv.c index 309255746..a72849f3e 100644 --- a/c/containers/lhmsv.c +++ b/c/containers/lhmsv.c @@ -81,6 +81,7 @@ void lhmsv_free(lhmsv_t* pmap) { free(pe->key); } free(pmap->entries); + free(pmap->states); pmap->entries = NULL; pmap->num_occupied = 0; pmap->num_freed = 0; diff --git a/c/mapping/lrec_evaluators.c b/c/mapping/lrec_evaluators.c index fa2f8ecd1..306dd480a 100644 --- a/c/mapping/lrec_evaluators.c +++ b/c/mapping/lrec_evaluators.c @@ -762,8 +762,10 @@ mv_t lrec_evaluator_x_ns_func(lrec_t* prec, context_t* pctx, void* pvstate) { mv_t val2 = pstate->parg2->pprocess_func(prec, pctx, pstate->parg2->pvstate); NULL_OR_ERROR_OUT(val2); - if (val2.type != MT_STRING) + if (val2.type != MT_STRING) { + mv_free(&val1); return MV_ERROR; + } return pstate->pfunc(&val1, &val2); } @@ -932,13 +934,18 @@ mv_t lrec_evaluator_s_sss_func(lrec_t* prec, context_t* pctx, void* pvstate) { mv_t val2 = pstate->parg2->pprocess_func(prec, pctx, pstate->parg2->pvstate); NULL_OR_ERROR_OUT(val2); - if (val2.type != MT_STRING) + if (val2.type != MT_STRING) { + mv_free(&val1); return MV_ERROR; + } mv_t val3 = pstate->parg3->pprocess_func(prec, pctx, pstate->parg3->pvstate); NULL_OR_ERROR_OUT(val3); - if (val3.type != MT_STRING) + if (val3.type != MT_STRING) { + mv_free(&val1); + mv_free(&val2); return MV_ERROR; + } return pstate->pfunc(&val1, &val2, &val3); } @@ -985,8 +992,10 @@ mv_t lrec_evaluator_x_srs_func(lrec_t* prec, context_t* pctx, void* pvstate) { mv_t val3 = pstate->parg3->pprocess_func(prec, pctx, pstate->parg3->pvstate); NULL_OR_ERROR_OUT(val3); - if (val3.type != MT_STRING) + if (val3.type != MT_STRING) { + mv_free(&val1); return MV_ERROR; + } return pstate->pfunc(&val1, &pstate->regex, pstate->psb, &val3); } diff --git a/c/mapping/mapper_uniq.c b/c/mapping/mapper_uniq.c index aebbd337a..4ecf69947 100644 --- a/c/mapping/mapper_uniq.c +++ b/c/mapping/mapper_uniq.c @@ -227,7 +227,6 @@ static sllv_t* mapper_uniq_process_no_counts(lrec_t* pinrec, context_t* pctx, vo slls_t* pgroup_by_field_values = mlr_selected_values_from_record(pinrec, pstate->pgroup_by_field_names); if (pgroup_by_field_values == NULL) { - slls_free(pgroup_by_field_values); return NULL; } diff --git a/c/todo.txt b/c/todo.txt index 278e4c1ad..6a7799675 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -23,6 +23,7 @@ TOP OF LIST - track-origins? - xxxes - more rid of "double" in fcn names + - mv_format_val in case string is allocated. modify semantics to nullify the arg?? * profile new streqn vs. strncmp ... * mixed-format joins ... * stats1 handle empty-key nulls? stats2? step? top? etc ...