From: Alan T. DeKok Date: Fri, 23 Oct 2020 13:59:12 +0000 (-0400) Subject: don't mangle things until AFTER we've freed the children X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a52adb299460cf45745e2bd712dac97cebfa9f5d;p=thirdparty%2Ffreeradius-server.git don't mangle things until AFTER we've freed the children --- diff --git a/src/lib/util/pair.c b/src/lib/util/pair.c index 899e5dfaccd..7aa33b2652b 100644 --- a/src/lib/util/pair.c +++ b/src/lib/util/pair.c @@ -47,11 +47,6 @@ RCSID("$Id$") */ static int _fr_pair_free(VALUE_PAIR *vp) { - -#ifndef NDEBUG - vp->vp_uint32 = FREE_MAGIC; -#endif - #ifdef TALLOC_DEBUG talloc_report_depth_cb(NULL, 0, -1, fr_talloc_verify_cb, NULL); #endif @@ -69,6 +64,10 @@ static int _fr_pair_free(VALUE_PAIR *vp) break; } +#ifndef NDEBUG + memset(vp, 0, sizeof(*vp)); +#endif + return 0; }