diff --git a/lib/isc/netmgr/http.c b/lib/isc/netmgr/http.c index 5b67a8cbf0..79e93cbcb3 100644 --- a/lib/isc/netmgr/http.c +++ b/lib/isc/netmgr/http.c @@ -2105,8 +2105,15 @@ isc__nm_http_request(isc_nmhandle_t *handle, isc_region_t *region, return ISC_R_SUCCESS; error: + /* + * client_send() detaches and frees the stream on a submit failure + * (it nullifies sock->h2->connect.cstream before submitting, then + * frees it on the failure branch), so the reloaded pointer can be + * NULL here. The caller still gets the error result and reports the + * failure itself. + */ cstream = sock->h2->connect.cstream; - if (cstream->read_cb != NULL) { + if (cstream != NULL && cstream->read_cb != NULL) { cstream->read_cb(handle, result, NULL, cstream->read_cbarg); } return result;