]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Revert "fr_dict_finalise() should not free things it didn't allocate"
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 14 Aug 2019 23:30:53 +0000 (19:30 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 14 Aug 2019 23:30:53 +0000 (19:30 -0400)
This reverts commit 08f86bb070e4ecd0d080318d09c8d9d395b48067.

src/lib/util/dict.c

index 2bc826a74562ecfa1057e9c23dc7035c39794116..2425dfed65c6d27e61a71fbe942133c04826dc87 100644 (file)
@@ -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;
 }