summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/key.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2002-07-04 04:15:33 +0000
committerderaadt <deraadt@openbsd.org>2002-07-04 04:15:33 +0000
commitdea7d00eafb9cf6cfeade320ab261336ed45e994 (patch)
treef49584382c7ea08347623267b65ec4ecdc3b9fbe /usr.bin/ssh/key.c
parentcatch malloc failures, my changes; found by cloder@acm.org (diff)
downloadwireguard-openbsd-dea7d00eafb9cf6cfeade320ab261336ed45e994.tar.xz
wireguard-openbsd-dea7d00eafb9cf6cfeade320ab261336ed45e994.zip
patch memory leaks; grendel@zeitbombe.org
Diffstat (limited to 'usr.bin/ssh/key.c')
-rw-r--r--usr.bin/ssh/key.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ssh/key.c b/usr.bin/ssh/key.c
index 718cd16c0cd..34b36b0ebfe 100644
--- a/usr.bin/ssh/key.c
+++ b/usr.bin/ssh/key.c
@@ -32,7 +32,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
-RCSID("$OpenBSD: key.c,v 1.46 2002/06/30 21:59:45 deraadt Exp $");
+RCSID("$OpenBSD: key.c,v 1.47 2002/07/04 04:15:33 deraadt Exp $");
#include <openssl/evp.h>
@@ -763,6 +763,8 @@ key_to_blob(Key *key, u_char **blobp, u_int *lenp)
*lenp = len;
if (blobp != NULL)
*blobp = buf;
+ else
+ xfree(buf);
return len;
}