4110. [bug] Address memory leaks / null pointer dereferences

on out of memory. [RT #39310]

(cherry picked from commit b292230ab8)
This commit is contained in:
Mark Andrews
2015-04-29 03:16:50 +10:00
parent 7dc09dd9ab
commit fdb83d87d6
8 changed files with 41 additions and 10 deletions

View File

@@ -266,8 +266,10 @@ load(const char *filename, const char *origintext, isc_boolean_t cache) {
dns_fixedname_init(&forigin);
origin = dns_fixedname_name(&forigin);
result = dns_name_fromtext(origin, &source, dns_rootname, 0, NULL);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, dbi, sizeof(*dbi));
return (result);
}
result = dns_db_create(mctx, dbtype, origin,
cache ? dns_dbtype_cache : dns_dbtype_zone,