unbound: Fix memory leak

This commit is contained in:
Tobias Brunner
2016-09-20 15:36:14 +02:00
parent 8c33a1897a
commit 3a25032c16
@@ -154,11 +154,13 @@ unbound_rr_t *unbound_rr_create_frm_ldns_rr(ldns_rr *rr)
if (status != LDNS_STATUS_OK) if (status != LDNS_STATUS_OK)
{ {
DBG1(DBG_LIB, "failed to get the RDATA field of a DNS RR"); DBG1(DBG_LIB, "failed to get the RDATA field of a DNS RR");
ldns_buffer_free(buf);
_destroy(this); _destroy(this);
return NULL; return NULL;
} }
this->rdata = ldns_buffer_export(buf); this->rdata = ldns_buffer_export(buf);
ldns_buffer_free(buf);
return &this->public; return &this->public;
} }