fix potential NetX packet memory leak

This commit is contained in:
toddouska
2013-06-26 11:03:54 -07:00
parent 87eb94b7c4
commit 60c2388ae7
2 changed files with 5 additions and 1 deletions

View File

@ -1683,6 +1683,10 @@ void SSL_ResourceFree(CYASSL* ssl)
#ifdef HAVE_TLS_EXTENSIONS
TLSX_FreeAll(ssl->extensions);
#endif
#ifdef HAVE_NETX
if (ssl->nxCtx.nxPacket)
nx_packet_release(ssl->nxCtx.nxPacket);
#endif
}

View File

@ -947,7 +947,7 @@ int NetX_Receive(CYASSL *ssl, char *buf, int sz, void *ctx)
CYASSL_MSG("NetX Recv Drained packet");
nx_packet_release(nxCtx->nxPacket);
nxCtx->nxPacket = NULL;
nxCtx->nxOffset = 0;
nxCtx->nxOffset = 0;
}
}