Plug memory leaks in request_pty and channel->channel_type
This commit is contained in:
parent
7a5ffc8cee
commit
2f41af6cdf
@ -337,6 +337,7 @@ LIBSSH2_API int libssh2_channel_request_pty_ex(LIBSSH2_CHANNEL *channel, char *t
|
||||
LIBSSH2_FREE(session, packet);
|
||||
return -1;
|
||||
}
|
||||
LIBSSH2_FREE(session, packet);
|
||||
|
||||
while (1) {
|
||||
unsigned char *data;
|
||||
@ -663,6 +664,11 @@ LIBSSH2_API int libssh2_channel_free(LIBSSH2_CHANNEL *channel)
|
||||
LIBSSH2_FREE(session, data);
|
||||
}
|
||||
|
||||
/* free "channel_type" */
|
||||
if (channel->channel_type) {
|
||||
LIBSSH2_FREE(session, channel->channel_type);
|
||||
}
|
||||
|
||||
/* Unlink from channel brigade */
|
||||
if (channel->prev) {
|
||||
channel->prev->next = channel->next;
|
||||
|
Loading…
x
Reference in New Issue
Block a user