Skip to content

Commit

Permalink
Fix uninitialized http_context (possible lead to error if we add prop…
Browse files Browse the repository at this point in the history
…erties to it but may not notice that)

(cherry picked from commit 97cec52)
  • Loading branch information
twose committed Jan 16, 2020
1 parent bddbb9b commit ce77c64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion swoole_http2_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ int swoole_http2_server_onFrame(swServer *serv, swConnection *conn, swEventData
client->handle = swoole_http2_onRequest;
if (!client->default_ctx)
{
client->default_ctx = (http_context *) emalloc(sizeof(*client->default_ctx));
client->default_ctx = (http_context *) ecalloc(1, sizeof(http_context));
swoole_http_server_init_context(serv, client->default_ctx);
client->default_ctx->fd = session_id;
client->default_ctx->http2 = true;
Expand Down

0 comments on commit ce77c64

Please sign in to comment.