summaryrefslogtreecommitdiffhomepage
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
commitee6f01918cf4a2eee1dabd34798533bfcb5e28fb (patch)
tree6b7c19196fce2ec5dbf1e3af2b5aad5a27175a56
parentd57a56407b3230672d9320d25d11fc2ec58e359f (diff)
Free x component of DSS key upon failure to load
(found by Klocwork) --HG-- extra : convert_revision : 8dd57944c592d5d74680657e437fca8803680bd0
-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;
}