2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

'dir_list' must be non NULL, remove test.

707 complete_allnds:

	CID 1452689 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking dir_list suggests that it
	may be null, but it has already been dereferenced on all
	paths leading to the check.

708        if (dir_list != NULL) {
709                /* clean up entries from list. */
This commit is contained in:
Mark Andrews
2020-02-05 16:49:09 +11:00
parent 7ba1af0280
commit bf7a99a3c1

View File

@@ -688,19 +688,18 @@ fs_allnodes(const char *zone, void *driverarg, void *dbdata,
} /* end while */
complete_allnds:
if (dir_list != NULL) {
/* clean up entries from list. */
dir_entry = ISC_LIST_HEAD(*dir_list);
while (dir_entry != NULL) {
next_de = ISC_LIST_NEXT(dir_entry, link);
isc_mem_put(named_g_mctx, dir_entry, sizeof(dir_entry_t));
dir_entry = next_de;
} /* end while */
isc_mem_put(named_g_mctx, dir_list, sizeof(dlist_t));
}
/* clean up entries from list. */
dir_entry = ISC_LIST_HEAD(*dir_list);
while (dir_entry != NULL) {
next_de = ISC_LIST_NEXT(dir_entry, link);
isc_mem_put(named_g_mctx, dir_entry, sizeof(dir_entry_t));
dir_entry = next_de;
} /* end while */
isc_mem_put(named_g_mctx, dir_list, sizeof(dlist_t));
if (basepath != NULL)
if (basepath != NULL) {
isc_mem_free(named_g_mctx, basepath);
}
return (result);
}