From ee6f01918cf4a2eee1dabd34798533bfcb5e28fb Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Thu, 2 Nov 2006 14:49:20 +0000 Subject: [PATCH] Free x component of DSS key upon failure to load (found by Klocwork) --HG-- extra : convert_revision : 8dd57944c592d5d74680657e437fca8803680bd0 --- dss.c | 3 +++ 1 file changed, 3 insertions(+) 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; }