1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

wsproxy: clear down proxy struct at alloc

This commit is contained in:
Andy Green 2019-10-07 16:08:50 +01:00
parent 3c95483518
commit db760fa164

View file

@ -153,11 +153,10 @@ lws_callback_ws_proxy(struct lws *wsi, enum lws_callback_reasons reason,
__func__);
return -1;
}
pkt = lws_malloc(sizeof(*pkt) + LWS_PRE + len, __func__);
pkt = lws_zalloc(sizeof(*pkt) + LWS_PRE + len, __func__);
if (!pkt)
return -1;
pkt->pkt_list.prev = pkt->pkt_list.next = NULL;
pkt->len = len;
pkt->first = lws_is_first_fragment(wsi);
pkt->final = lws_is_final_fragment(wsi);
@ -200,11 +199,10 @@ lws_callback_ws_proxy(struct lws *wsi, enum lws_callback_reasons reason,
return -1;
case LWS_CALLBACK_RECEIVE:
pkt = lws_malloc(sizeof(*pkt) + LWS_PRE + len, __func__);
pkt = lws_zalloc(sizeof(*pkt) + LWS_PRE + len, __func__);
if (!pkt)
return -1;
pkt->pkt_list.prev = pkt->pkt_list.next = NULL;
pkt->len = len;
pkt->first = lws_is_first_fragment(wsi);
pkt->final = lws_is_final_fragment(wsi);