valgrind findings

This commit is contained in:
John Kerl 2015-12-19 21:10:10 -05:00
parent 3c125ba79d
commit 2aaf76511a
8 changed files with 19 additions and 5 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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 ...