]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
ensure that the map is parented by parent, not by ctx
authorAlan T. DeKok <aland@freeradius.org>
Fri, 21 May 2021 13:56:48 +0000 (09:56 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 21 May 2021 17:37:04 +0000 (13:37 -0400)
src/lib/server/map.c

index 9948a11939334035057f837c41fc585ba0c3a884..529b602b0140ea0d75b00fc3aecfa00b101d40b4 100644 (file)
@@ -60,7 +60,11 @@ static inline map_t *map_alloc(TALLOC_CTX *ctx, map_t *parent)
 {
        map_t *map;
 
-       map = talloc_zero(ctx, map_t);
+       if (parent) {
+               map = talloc_zero(parent, map_t);
+       } else {
+               map = talloc_zero(ctx, map_t);
+       }
        map->parent = parent;
 
        fr_map_list_init(&map->child);