]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
rr.c: (ldns_wire2dname) Free allocated memory and return error code if
authorErik Rozendaal <erik@NLnetLabs.nl>
Thu, 16 Dec 2004 15:22:31 +0000 (15:22 +0000)
committerErik Rozendaal <erik@NLnetLabs.nl>
Thu, 16 Dec 2004 15:22:31 +0000 (15:22 +0000)
call to ldns_rdf_new() fails.

wire2host.c

index 26650f396fe03a287f03f93c3175bb1599f29e34..675326ced88ee726966c725d15a69a4ecead2528 100644 (file)
@@ -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;
 }