File 0008-CVE-2012-4559-Ensure-that-we-don-t-free-req-twice.patch of Package libssh.openSUSE_12.1_Update
From d8b03cfe3869a57e4a6367b4a03681715d38102e Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@cryptomilk.org>
Date: Fri, 5 Oct 2012 14:39:51 +0200
Subject: [PATCH 08/11] CVE-2012-4559: Ensure that we don't free req twice.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit b9e249a396f4f0f135817e59f4d8323b58231e97)
---
src/channels.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/channels.c b/src/channels.c
index b6ad996..0d63fe7 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -1400,6 +1400,7 @@ static int channel_request(ssh_channel channel, const char *request,
buffer_add_ssh_string(session->out_buffer, req) < 0 ||
buffer_add_u8(session->out_buffer, reply == 0 ? 0 : 1) < 0) {
ssh_set_error_oom(session);
+ ssh_string_free(req);
goto error;
}
ssh_string_free(req);
@@ -1459,7 +1460,6 @@ static int channel_request(ssh_channel channel, const char *request,
return rc;
error:
buffer_reinit(session->out_buffer);
- ssh_string_free(req);
leave_function();
return rc;
--
1.7.10.4