unbound: Fix memory leak
authorTobias Brunner <tobias@strongswan.org>
Tue, 13 Sep 2016 12:12:29 +0000 (14:12 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 20 Sep 2016 13:36:14 +0000 (15:36 +0200)
src/libstrongswan/plugins/unbound/unbound_rr.c

index fc69eed..91b5cdb 100644 (file)
@@ -154,11 +154,13 @@ unbound_rr_t *unbound_rr_create_frm_ldns_rr(ldns_rr *rr)
        if (status != LDNS_STATUS_OK)
        {
                DBG1(DBG_LIB, "failed to get the RDATA field of a DNS RR");
+               ldns_buffer_free(buf);
                _destroy(this);
                return NULL;
        }
 
        this->rdata = ldns_buffer_export(buf);
+       ldns_buffer_free(buf);
 
        return &this->public;
 }