mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 07:35:26 +00:00
Address use before NULL check warning of obj
move deference of obj to after NULL check
This commit is contained in:
@@ -2247,12 +2247,14 @@ cleanup:
|
|||||||
|
|
||||||
void
|
void
|
||||||
cfg_print_spacelist(cfg_printer_t *pctx, const cfg_obj_t *obj) {
|
cfg_print_spacelist(cfg_printer_t *pctx, const cfg_obj_t *obj) {
|
||||||
const cfg_list_t *list = &obj->value.list;
|
const cfg_list_t *list = NULL;
|
||||||
const cfg_listelt_t *elt;
|
const cfg_listelt_t *elt = NULL;
|
||||||
|
|
||||||
REQUIRE(pctx != NULL);
|
REQUIRE(pctx != NULL);
|
||||||
REQUIRE(obj != NULL);
|
REQUIRE(obj != NULL);
|
||||||
|
|
||||||
|
list = &obj->value.list;
|
||||||
|
|
||||||
for (elt = ISC_LIST_HEAD(*list); elt != NULL;
|
for (elt = ISC_LIST_HEAD(*list); elt != NULL;
|
||||||
elt = ISC_LIST_NEXT(elt, link)) {
|
elt = ISC_LIST_NEXT(elt, link)) {
|
||||||
cfg_print_obj(pctx, elt->obj);
|
cfg_print_obj(pctx, elt->obj);
|
||||||
|
Reference in New Issue
Block a user