aliyun / iotkit-embedded

高速镜像: https://code.aliyun.com/linkkit/c-sdk
Apache License 2.0
496 stars 252 forks source link

[http] Memory leak with wrapper_http_deinit(...) call #162

Open ccli8 opened 4 years ago

ccli8 commented 4 years ago

iotkit-embedded 3e60c94b (HEAD, origin/v3.1.0) [dev_model] change data type of alink msgid to int

In both the functions below, the wrapper_http_deinit(...) call must fix to wrapper_http_deinit(&http_handle):

src/http/iotx_http_api.c:

int IOT_HTTP_SendMessage(void *handle, iotx_http_message_param_t *msg_param)
{
......
do_exit_pre:

    if (http_handle) {
        wrapper_http_deinit(http_handle);
        http_handle = NULL;
    }
......
int IOT_HTTP_DeviceNameAuth(void *handle)
{
......
do_exit_pre:

    if (http_handle) {
        wrapper_http_deinit(http_handle);
        http_handle = NULL;
    }
......