]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't mangle things until AFTER we've freed the children
authorAlan T. DeKok <aland@freeradius.org>
Fri, 23 Oct 2020 13:59:12 +0000 (09:59 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 23 Oct 2020 13:59:37 +0000 (09:59 -0400)
src/lib/util/pair.c

index 899e5dfaccd074f4b4b93930481d93dd04fc916a..7aa33b2652b3ab286c22cf8466c3d43a5f9890c4 100644 (file)
@@ -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;
 }