aboutsummaryrefslogtreecommitdiff
path: root/libssh/messages.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2008-06-30 22:28:11 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2008-06-30 22:28:11 +0000
commitd477025000c4d6717f9501cc8d382eed06fbe868 (patch)
tree449d1758108d4d7ea969b04df2ce0e6202ee705b /libssh/messages.c
parent5758188467194aa04ad854b77167ec360bdac463 (diff)
downloadlibssh-d477025000c4d6717f9501cc8d382eed06fbe868.tar.gz
libssh-d477025000c4d6717f9501cc8d382eed06fbe868.tar.xz
libssh-d477025000c4d6717f9501cc8d382eed06fbe868.zip
fix bug 0000015 about memory leak in server path
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@180 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/messages.c')
-rw-r--r--libssh/messages.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libssh/messages.c b/libssh/messages.c
index e609cbc6..e9c99b1a 100644
--- a/libssh/messages.c
+++ b/libssh/messages.c
@@ -84,6 +84,8 @@ static SSH_MESSAGE *handle_userauth_request(SSH_SESSION *session){
free(user);
service_c=string_to_char(service);
method_c=string_to_char(method);
+ free(service);
+ free(method);
ssh_say(2,"auth request for service %s, method %s for user '%s'\n",service_c,method_c,
msg->auth_request.username);
free(service_c);
@@ -182,10 +184,12 @@ static SSH_MESSAGE *handle_channel_request_open(SSH_SESSION *session){
msg->channel_request_open.packet_size=ntohl(packet);
if(!strcmp(type_c,"session")){
msg->channel_request_open.type=SSH_CHANNEL_SESSION;
+ free(type_c);
leave_function();
return msg;
}
msg->channel_request_open.type=SSH_CHANNEL_UNKNOWN;
+ free(type_c);
leave_function();
return msg;
}
@@ -247,6 +251,7 @@ static SSH_MESSAGE *handle_channel_request(SSH_SESSION *session){
if(!strcmp(type_c,"pty-req")){
STRING *term;
char *term_c;
+ free(type_c);
term=buffer_get_ssh_string(session->in_buffer);
term_c=string_to_char(term);
free(term);
@@ -267,6 +272,7 @@ static SSH_MESSAGE *handle_channel_request(SSH_SESSION *session){
if(!strcmp(type_c,"subsystem")){
STRING *subsys;
char *subsys_c;
+ free(type_c);
subsys=buffer_get_ssh_string(session->in_buffer);
subsys_c=string_to_char(subsys);
free(subsys);
@@ -276,12 +282,14 @@ static SSH_MESSAGE *handle_channel_request(SSH_SESSION *session){
return msg;
}
if(!strcmp(type_c,"shell")){
+ free(type_c);
msg->channel_request.type=SSH_CHANNEL_REQUEST_SHELL;
leave_function();
return msg;
}
if(!strcmp(type_c,"exec")){
STRING *cmd=buffer_get_ssh_string(session->in_buffer);
+ free(type_c);
msg->channel_request.type=SSH_CHANNEL_REQUEST_EXEC;
msg->channel_request.command=string_to_char(cmd);
free(cmd);
@@ -290,6 +298,7 @@ static SSH_MESSAGE *handle_channel_request(SSH_SESSION *session){
}
msg->channel_request.type=SSH_CHANNEL_UNKNOWN;
+ free(type_c);
leave_function();
return msg;
}