http2: cleanup pushed newhandle on fail

When nghttp2_session_set_stream_user_data() fails, clean up the
new handle.

Reported-by: Joshua Rogers
Closes #18931
This commit is contained in:
Stefan Eissing 2025-10-08 12:28:14 +02:00 committed by Daniel Stenberg
parent 93e91e965e
commit 44a79d4f7a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -1030,6 +1030,7 @@ static int push_promise(struct Curl_cfilter *cf,
infof(data, "failed to set user_data for stream %u",
newstream->id);
DEBUGASSERT(0);
discard_newhandle(cf, newhandle);
rv = CURL_PUSH_DENY;
goto fail;
}