Skip to content

疑似内存泄漏 #802

@cjl3230

Description

@cjl3230

首先感谢作者开源了这么好的一个库,使用过程中发现好像有个内存泄漏的地方.麻烦看看
https://github.com/ithewei/libhv/blob/master/ssl/wintls.c#L160

    hCred = (CredHandle*)malloc(sizeof(CredHandle));
    if (hCred == NULL) {
        return NULL;
    }

这里malloc了一个CredHandle* hCred 在 hssl_ctx_free 中好像没有free
https://github.com/ithewei/libhv/blob/master/ssl/wintls.c#L183

void hssl_ctx_free(hssl_ctx_t ssl_ctx)
{
    SECURITY_STATUS sec_status = FreeCredentialsHandle(ssl_ctx);
    if (sec_status != SEC_E_OK) {
        printe("free_cred_handle FreeCredentialsHandle %d\n", sec_status);
    }
}

这应该会导致内存泄漏吧

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions