From: Arran Cudbard-Bell Date: Wed, 14 Aug 2019 23:30:53 +0000 (-0400) Subject: Revert "fr_dict_finalise() should not free things it didn't allocate" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdb5af734b5ef5c0e005fa65e3bec6403348d8a5;p=thirdparty%2Ffreeradius-server.git Revert "fr_dict_finalise() should not free things it didn't allocate" This reverts commit 08f86bb070e4ecd0d080318d09c8d9d395b48067. --- diff --git a/src/lib/util/dict.c b/src/lib/util/dict.c index 2bc826a7456..2425dfed65c 100644 --- a/src/lib/util/dict.c +++ b/src/lib/util/dict.c @@ -4830,6 +4830,7 @@ static int fr_dict_finalise(dict_from_file_ctx_t *ctx) ctx->enum_fixup = next; } } + TALLOC_FREE(ctx->fixup_pool); /* * Walk over all of the hash tables to ensure they're @@ -5546,7 +5547,7 @@ static int dict_from_file(fr_dict_t *dict, rcode = _dict_from_file(&ctx, dir_name, filename, src_file, src_line); if (rcode < 0) { - TALLOC_FREE(ctx.fixup_pool); + // free up the various fixups return rcode; } @@ -5557,10 +5558,7 @@ static int dict_from_file(fr_dict_t *dict, * Fixups should have been applied already to any protocol * dictionaries. */ - rcode = fr_dict_finalise(&ctx); - if (rcode < 0) TALLOC_FREE(ctx.fixup_pool); - - return rcode; + return fr_dict_finalise(&ctx); } /** (Re-)Initialize the special internal dictionary @@ -6002,7 +6000,6 @@ int fr_dict_parse_str(fr_dict_t *dict, char *buf, fr_dict_attr_t const *parent) } fr_dict_finalise(&ctx); - TALLOC_FREE(ctx.fixup_pool); return 0; }