未验证 提交 0d7a74cc 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #1179 from uestczyh222/master

[Components][Drivers][USB]fix memory leak
......@@ -486,7 +486,10 @@ static rt_err_t _function_enable(ufunction_t func)
//
// _vcom_reset_state(func);
//
data->ep_out->buffer = rt_malloc(HID_RX_BUFSIZE);
if(data->ep_out->buffer == RT_NULL)
{
data->ep_out->buffer = rt_malloc(HID_RX_BUFSIZE);
}
data->ep_out->request.buffer = data->ep_out->buffer;
data->ep_out->request.size = EP_MAXPACKET(data->ep_out);
data->ep_out->request.req_type = UIO_REQUEST_READ_BEST;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册