summaryrefslogtreecommitdiff
path: root/dss.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2006-11-02 14:49:20 +0000
committerMatt Johnston <matt@ucc.asn.au>2006-11-02 14:49:20 +0000
commit1ac78b3c5fe52644ff261affcbc177efa6e0625f (patch)
tree6b7c19196fce2ec5dbf1e3af2b5aad5a27175a56 /dss.c
parente56236b7ee7305582035a0223b6056df7afaedc4 (diff)
downloaddropbear-1ac78b3c5fe52644ff261affcbc177efa6e0625f.tar.gz
Free x component of DSS key upon failure to load
(found by Klocwork)
Diffstat (limited to 'dss.c')
-rw-r--r--dss.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dss.c b/dss.c
index 84a093c..9b25dcc 100644
--- a/dss.c
+++ b/dss.c
@@ -90,6 +90,9 @@ int buf_get_dss_priv_key(buffer* buf, dss_key *key) {
key->x = m_malloc(sizeof(mp_int));
m_mp_init(key->x);
ret = buf_getmpint(buf, key->x);
+ if (ret == DROPBEAR_FAILURE) {
+ m_free(key->x);
+ }
return ret;
}