]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- rpz-triggers, fix memory allocation trouble on allocation error path.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 14 May 2021 11:35:24 +0000 (13:35 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 14 May 2021 11:35:24 +0000 (13:35 +0200)
services/rpz.c

index c06e096ae2f57d54d92a09f3155929d56827af31..9c05e69a5849b453b9b2d06fcc6bc2533372431b 100644 (file)
@@ -387,11 +387,15 @@ rpz_clear(struct rpz* r)
 {
        /* must hold write lock on auth_zone */
        local_zones_delete(r->local_zones);
+       r->local_zones = NULL;
        local_zones_delete(r->nsdname_zones);
+       r->nsdname_zones = NULL;
        respip_set_delete(r->respip_set);
+       r->respip_set = NULL;
        rpz_clientip_synthesized_set_delete(r->client_set);
+       r->client_set = NULL;
        rpz_clientip_synthesized_set_delete(r->ns_set);
-       // XXX: this approach seems to leak memory
+       r->ns_set = NULL;
        if(!(r->local_zones = local_zones_create())){
                return 0;
        }