From: Erik Rozendaal Date: Thu, 16 Dec 2004 15:22:31 +0000 (+0000) Subject: rr.c: (ldns_wire2dname) Free allocated memory and return error code if X-Git-Tag: release-0.50~639 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=001b8b5180ec8a5a12dbe6bc1f46cbb4dba4f26d;p=thirdparty%2Fldns.git rr.c: (ldns_wire2dname) Free allocated memory and return error code if call to ldns_rdf_new() fails. --- diff --git a/wire2host.c b/wire2host.c index 26650f39..675326ce 100644 --- a/wire2host.c +++ b/wire2host.c @@ -302,6 +302,10 @@ ldns_wire2dname(ldns_rdf **dname, const uint8_t *wire, size_t max, size_t *pos) *dname = ldns_rdf_new((uint16_t) dname_pos, LDNS_RDF_TYPE_DNAME, dname_ar); + if (!*dname) { + FREE(dname_ar); + return LDNS_STATUS_MEM_ERR; + } return LDNS_STATUS_OK; }