mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Silence CID 464884 (REVERSE_INULL)
*** CID 464884: Null pointer dereferences (REVERSE_INULL)
/bin/tests/system/dyndb/driver/db.c: 644 in create_db()
638
639 *dbp = (dns_db_t *)sampledb;
640
641 return (ISC_R_SUCCESS);
642
643 cleanup:
CID 464884: Null pointer dereferences (REVERSE_INULL)
Null-checking "sampledb" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
644 if (sampledb != NULL) {
645 if (dns_name_dynamic(&sampledb->common.origin)) {
646 dns_name_free(&sampledb->common.origin, mctx);
647 }
648
649 isc_mem_putanddetach(&sampledb->common.mctx, sampledb,
This commit is contained in:
parent
62fb970d0a
commit
60630fe3aa
1 changed files with 5 additions and 7 deletions
|
|
@ -641,14 +641,12 @@ create_db(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
|
|||
return (ISC_R_SUCCESS);
|
||||
|
||||
cleanup:
|
||||
if (sampledb != NULL) {
|
||||
if (dns_name_dynamic(&sampledb->common.origin)) {
|
||||
dns_name_free(&sampledb->common.origin, mctx);
|
||||
}
|
||||
|
||||
isc_mem_putanddetach(&sampledb->common.mctx, sampledb,
|
||||
sizeof(*sampledb));
|
||||
if (dns_name_dynamic(&sampledb->common.origin)) {
|
||||
dns_name_free(&sampledb->common.origin, mctx);
|
||||
}
|
||||
|
||||
isc_mem_putanddetach(&sampledb->common.mctx, sampledb,
|
||||
sizeof(*sampledb));
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue