summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/bufbn.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2007-06-02 09:04:59 +0000
committerDamien Miller <djm@cvs.openbsd.org>2007-06-02 09:04:59 +0000
commit624c025cafa77c0512336f49d57bf6c1fb9ad027 (patch)
treeb0bccf9a3aad504dbb85d1fa63ffb98f14d864f4 /usr.bin/ssh/bufbn.c
parent81fddecfcf1580d324a4de15baf9ff3794033919 (diff)
memory leak on error path; from arnaud.lacombe.1 AT ulaval.ca
Diffstat (limited to 'usr.bin/ssh/bufbn.c')
-rw-r--r--usr.bin/ssh/bufbn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ssh/bufbn.c b/usr.bin/ssh/bufbn.c
index a1c7ed29975..18cdd70d4b2 100644
--- a/usr.bin/ssh/bufbn.c
+++ b/usr.bin/ssh/bufbn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bufbn.c,v 1.5 2007/02/14 14:32:00 stevesk Exp $*/
+/* $OpenBSD: bufbn.c,v 1.6 2007/06/02 09:04:58 djm Exp $*/
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -199,12 +199,14 @@ buffer_get_bignum2_ret(Buffer *buffer, BIGNUM *value)
return (-1);
}
if (len > 8 * 1024) {
- error("buffer_get_bignum2_ret: cannot handle BN of size %d", len);
+ error("buffer_get_bignum2_ret: cannot handle BN of size %d",
+ len);
xfree(bin);
return (-1);
}
if (BN_bin2bn(bin, len, value) == NULL) {
error("buffer_get_bignum2_ret: BN_bin2bn failed");
+ xfree(bin);
return (-1);
}
xfree(bin);