Fix parse_rr in lib/dns/skr.c was failing to reset the comments

If dns_name_fromtext failed or the subsequent dns_name_compare
failed the lexer's comments state wasn't cleaned up.
This commit is contained in:
Mark Andrews 2025-10-14 11:26:45 +11:00
parent 9cacda4709
commit e5ceda617d

View file

@ -74,10 +74,11 @@ parse_rr(isc_lex_t *lex, isc_mem_t *mctx, char *owner, dns_name_t *origin,
isc_buffer_add(&b, strlen(owner));
ret = dns_name_fromtext(dname, &b, dns_rootname, 0);
if (ret != ISC_R_SUCCESS) {
return ret;
goto cleanup;
}
if (dns_name_compare(dname, origin) != 0) {
return DNS_R_BADOWNERNAME;
ret = DNS_R_BADOWNERNAME;
goto cleanup;
}
isc_buffer_clear(&b);