]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
utils: fix coverity warning 155456
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 11 Jan 2017 14:27:04 +0000 (15:27 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 11 Jan 2017 14:29:02 +0000 (15:29 +0100)
I think the memory wouldn't really leak, due to being on a per-request
mempool, but it still seems better to do this properly.

lib/utils.c

index 35a7c19b2a7e7f0a01c4934a2c1c39f46954d2b7..2588ba159510bc71d83892ba2503bb98b321c3f4 100644 (file)
@@ -450,6 +450,7 @@ int kr_ranked_rrarray_add(ranked_rr_array_t *array, const knot_rrset_t *rr,
        }
        knot_rrset_t *copy = knot_rrset_copy(rr, pool);
        if (!copy) {
+               mm_free(pool, entry);
                return kr_error(ENOMEM);
        }