[9.18] fix: test: Various coccinelle fixes

Backport of MR !9836

Merge branch 'backport-mnowak/cocci-more-set-if-not-null-changes-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9917
This commit is contained in:
Michal Nowak
2024-12-13 15:34:11 +00:00

View File

@@ -400,15 +400,9 @@ extract_qctx(void *arg, void *data, isc_result_t *resultp) {
* gets unwound.
*/
qctx = isc_mem_get(mctx, sizeof(*qctx));
if (qctx != NULL) {
memmove(qctx, (query_ctx_t *)arg, sizeof(*qctx));
}
memmove(qctx, (query_ctx_t *)arg, sizeof(*qctx));
qctxp = (query_ctx_t **)data;
/*
* If memory allocation failed, the supplied pointer will simply be set
* to NULL. We rely on the user of this hook to react properly.
*/
*qctxp = qctx;
*resultp = ISC_R_UNSET;