From f80efcc26070bb6d42fca830d80aed3fca82206e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 1 Apr 2009 10:14:26 +0000 Subject: Add checks for memory errors in channel functions. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@314 7dcaeef0-15fb-0310-b436-a5af3365683c --- libssh/messages.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libssh/messages.c') diff --git a/libssh/messages.c b/libssh/messages.c index edd898b..3a8356a 100644 --- a/libssh/messages.c +++ b/libssh/messages.c @@ -215,6 +215,10 @@ CHANNEL *ssh_message_channel_request_open_reply_accept(SSH_MESSAGE *msg){ enter_function(); chan=channel_new(session); + if (chan == NULL) { + leave_function(); + return NULL; + } chan->local_channel=ssh_channel_new_id(session); chan->local_maxpacket=35000; chan->local_window=32000; -- cgit