The cleanup path always unlocks the 'view->newzone.lock' lock, but
there are 'goto cleanup;' operations even before the lock is locked,
which causes an assertion failure.
Don't use the cleanup path before the lock is locked.
if (!view->newzone.allowed) {
result = ISC_R_NOPERM;
- TCHECK(putstr(text, "new zone configuration is not allowed"));
- goto cleanup;
+ tresult = putstr(text, "new zone configuration is not allowed");
+ if (tresult != ISC_R_SUCCESS) {
+ isc_buffer_clear(text);
+ }
+ return result;
}
/* Zone must already exist */
result = dns_view_findzone(view, name, DNS_ZTFIND_EXACT, &zone);
}
if (result != ISC_R_SUCCESS) {
- goto cleanup;
+ return result;
}
added = dns_zone_getadded(zone);