check target pointer validity in qctx_save

Make sure the target pointer address (getting the allocated instance of
qctx) is valid and the pointer is NULL.
This commit is contained in:
Evan Hunt 2025-09-09 12:55:06 -07:00 committed by Colin Vidal
parent f1568c1729
commit 0194a265fe

View file

@ -5229,6 +5229,8 @@ qctx_destroy(query_ctx_t *qctx) {
*/
static void
qctx_save(query_ctx_t *src, query_ctx_t **targetp) {
REQUIRE(targetp != NULL && *targetp == NULL);
query_ctx_t *target = isc_mem_get(src->client->manager->mctx,
sizeof(query_ctx_t));