]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
rplan: fix a coverity warning (CID 164834)
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 30 Jun 2017 06:48:59 +0000 (08:48 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 30 Jun 2017 06:51:22 +0000 (08:51 +0200)
There would be no real resource leak, as the memory is on a mempool,
so the lifetime is limited by kr_request finishing.  Also, it's only
on an unlikely error branch, but still...

lib/rplan.c

index 68458ed5e8a6e7dd0efea28e44f11bc82b0649ac..d2592414c69e5fbd151f30b07b99578a6dacff71 100644 (file)
@@ -143,6 +143,7 @@ static struct kr_query *kr_rplan_push_query(struct kr_rplan *rplan,
        if (parent && (parent->flags & qry->flags & QUERY_FORWARD)) {
                ret = kr_nsrep_copy_set(&qry->ns, &parent->ns);
                if (ret) {
+                       query_free(rplan->pool, qry);
                        return NULL;
                }
        }