mirror of https://github.com/FreeRDP/FreeRDP
setting pointers to NULL after freeing memory to avoid crashes.
gitignore: only top-level "external" folder is ignored.
This commit is contained in:
parent
3951a6e1c3
commit
5bfca61261
|
@ -15,7 +15,7 @@ DartConfiguration.tcl
|
|||
CMakeCPackOptions.cmake
|
||||
_CPack_Packages
|
||||
LICENSE.txt
|
||||
external/*
|
||||
/external/*
|
||||
!external/README
|
||||
|
||||
*.a.objlist.cmake
|
||||
|
|
|
@ -70,10 +70,13 @@ rdpContext* freerdp_client_context_new(RDP_CLIENT_ENTRY_POINTS* pEntryPoints)
|
|||
void freerdp_client_context_free(rdpContext* context)
|
||||
{
|
||||
freerdp* instance = context->instance;
|
||||
|
||||
freerdp_context_free(instance);
|
||||
free(instance->pClientEntryPoints);
|
||||
freerdp_free(instance);
|
||||
if (instance)
|
||||
{
|
||||
freerdp_context_free(instance);
|
||||
free(instance->pClientEntryPoints);
|
||||
freerdp_free(instance);
|
||||
context->instance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int freerdp_client_start(rdpContext* context)
|
||||
|
|
|
@ -798,21 +798,32 @@ void tls_free(rdpTls* tls)
|
|||
if (tls != NULL)
|
||||
{
|
||||
if (tls->ssl)
|
||||
{
|
||||
SSL_free(tls->ssl);
|
||||
tls->ssl = NULL;
|
||||
}
|
||||
|
||||
if (tls->ctx)
|
||||
{
|
||||
SSL_CTX_free(tls->ctx);
|
||||
tls->ctx = NULL;
|
||||
}
|
||||
|
||||
if (tls->PublicKey)
|
||||
{
|
||||
free(tls->PublicKey);
|
||||
tls->PublicKey = NULL;
|
||||
}
|
||||
|
||||
if (tls->Bindings)
|
||||
{
|
||||
free(tls->Bindings->Bindings);
|
||||
free(tls->Bindings);
|
||||
tls->Bindings = NULL;
|
||||
}
|
||||
|
||||
certificate_store_free(tls->certificate_store);
|
||||
tls->certificate_store = NULL;
|
||||
|
||||
free(tls);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue