[Ttssh2-commit] [6709] free漏れを修正

svnno****@sourc***** svnno****@sourc*****
2017年 5月 9日 (火) 23:25:17 JST


Revision: 6709
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6709
Author:   doda
Date:     2017-05-09 23:25:17 +0900 (Tue, 09 May 2017)
Log Message:
-----------
free漏れを修正

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/ssh.c

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2017-05-09 14:24:23 UTC (rev 6708)
+++ trunk/ttssh2/ttxssh/ssh.c	2017-05-09 14:25:17 UTC (rev 6709)
@@ -9115,8 +9115,8 @@
 	FWDChannel *fc;
 	buffer_t *agent_msg;
 	unsigned int *agent_request_len;
-	unsigned char *response;
-	unsigned int resplen;
+	unsigned char *response = NULL;
+	unsigned int resplen = 0;
 
 
 	// \x95\xAA\x8A\x84\x82\xB3\x82ꂽ CHANNEL_DATA \x82̎\xF3\x90M\x82ɑΉ\x9E (2008.11.30 maya)
@@ -9178,6 +9178,9 @@
 		SSH_channel_send(pvar, local_channel_num, fc->remote_num,
 		                 SSH_AGENT_FAILURE_MSG, sizeof(SSH_AGENT_FAILURE_MSG), 0);
 	}
+	if (response) {
+		safefree(response);
+	}
 
 	// \x8Eg\x82\xA2\x8FI\x82\xED\x82\xC1\x82\xBD\x83o\x83b\x83t\x83@\x82\xF0\x83N\x83\x8A\x83A
 	buffer_clear(agent_msg);



Ttssh2-commit メーリングリストの案内