]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
session_pack: fix leak in error path
authorMichael Catanzaro <mcatanzaro@gnome.org>
Sun, 2 Feb 2020 15:47:25 +0000 (09:47 -0600)
committerMichael Catanzaro <mcatanzaro@gnome.org>
Sun, 2 Feb 2020 15:53:57 +0000 (09:53 -0600)
If called at the wrong time, it allocates the buffer sb and forgets to
clear it.

Signed-off-by: Michael Catanzaro <mcatanzaro@gnome.org>
lib/session_pack.c

index b655b71289ab50ff7abb529054f7005f4d672f4c..e5c21f24b5a6bac7e2e5762ec64eeb9709f2f495 100644 (file)
@@ -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;
 
        }