summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2020-02-02 09:47:25 -0600
committerMichael Catanzaro <mcatanzaro@gnome.org>2020-02-02 09:53:57 -0600
commit05ace838b3f67836a29a53282ec5a9b3cffd5680 (patch)
tree69cf5cbf1748e43c229318197a0f68f7f7038ad7
parentb4c52d8ad4a063d05100980f895e330ff6076de5 (diff)
downloadgnutls-05ace838b3f67836a29a53282ec5a9b3cffd5680.tar.gz
session_pack: fix leak in error path
If called at the wrong time, it allocates the buffer sb and forgets to clear it. Signed-off-by: Michael Catanzaro <mcatanzaro@gnome.org>
-rw-r--r--lib/session_pack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/session_pack.c b/lib/session_pack.c
index b655b71289..e5c21f24b5 100644
--- a/lib/session_pack.c
+++ b/lib/session_pack.c
@@ -143,7 +143,8 @@ _gnutls_session_pack(gnutls_session_t session,
}
break;
default:
- return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
+ ret = gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
+ goto fail;
}