From a09754206567af6ad8f620a1ae74d7220daad7dc Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 18 Jun 2010 04:43:09 +0000 Subject: fix memory leak in do_realpath() error path; bz#1771, patch from anicka AT suse.cz --- usr.bin/ssh/sftp-client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/ssh/sftp-client.c b/usr.bin/ssh/sftp-client.c index 927f4bf56ab..a222586b20a 100644 --- a/usr.bin/ssh/sftp-client.c +++ b/usr.bin/ssh/sftp-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-client.c,v 1.90 2009/10/11 10:41:26 dtucker Exp $ */ +/* $OpenBSD: sftp-client.c,v 1.91 2010/06/18 04:43:08 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -705,7 +705,8 @@ do_realpath(struct sftp_conn *conn, char *path) u_int status = buffer_get_int(&msg); error("Couldn't canonicalise: %s", fx2txt(status)); - return(NULL); + buffer_free(&msg); + return NULL; } else if (type != SSH2_FXP_NAME) fatal("Expected SSH2_FXP_NAME(%u) packet, got %u", SSH2_FXP_NAME, type); -- cgit v1.2.3