From 2f41af6cdf58290e8d01e37dae7de4e2be824ec9 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Wed, 8 Dec 2004 00:13:07 +0000 Subject: [PATCH] Plug memory leaks in request_pty and channel->channel_type --- src/channel.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/channel.c b/src/channel.c index bd2645c..23ab9df 100644 --- a/src/channel.c +++ b/src/channel.c @@ -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;