Commit becae652 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Fix leak

parent ba9f2c3a
...@@ -1051,17 +1051,24 @@ nghttp2_stream *nghttp2_session_open_stream(nghttp2_session *session, ...@@ -1051,17 +1051,24 @@ nghttp2_stream *nghttp2_session_open_stream(nghttp2_session *session,
flags |= NGHTTP2_STREAM_FLAG_PUSH; flags |= NGHTTP2_STREAM_FLAG_PUSH;
} }
nghttp2_stream_init(stream, stream_id, flags, initial_state, pri_spec->weight,
(int32_t)session->remote_settings.initial_window_size,
(int32_t)session->local_settings.initial_window_size,
stream_user_data, mem);
if (stream_alloc) { if (stream_alloc) {
nghttp2_stream_init(stream, stream_id, flags, initial_state,
pri_spec->weight,
(int32_t)session->remote_settings.initial_window_size,
(int32_t)session->local_settings.initial_window_size,
stream_user_data, mem);
rv = nghttp2_map_insert(&session->streams, &stream->map_entry); rv = nghttp2_map_insert(&session->streams, &stream->map_entry);
if (rv != 0) { if (rv != 0) {
nghttp2_stream_free(stream);
nghttp2_mem_free(mem, stream); nghttp2_mem_free(mem, stream);
return NULL; return NULL;
} }
} else {
stream->flags = flags;
stream->state = initial_state;
stream->weight = pri_spec->weight;
stream->stream_user_data = stream_user_data;
} }
switch (initial_state) { switch (initial_state) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment