]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
lib/ext/srp.c: Add gnutls_free() in the error path
authorJiasheng Jiang <jiashengjiangcool@gmail.com>
Fri, 11 Jul 2025 20:04:39 +0000 (20:04 +0000)
committerDaiki Ueno <ueno@gnu.org>
Mon, 28 Jul 2025 00:52:32 +0000 (09:52 +0900)
Add gnutls_free() in the error path to avoid potential memory leak if BUFFER_POP_DATUM fails.

Fixes: 8b038ab97 ("The auth_ and ext_ files were moved to respective directories.")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
lib/ext/srp.c

index 96a6116da9f021bb4204d1fde97a9ffbf722109f..409ba20a603c6d68b87e724f861b6b6b31e6558f 100644 (file)
@@ -258,6 +258,7 @@ static int _gnutls_srp_unpack(gnutls_buffer_st *ps,
 error:
        _gnutls_free_datum(&username);
        _gnutls_free_datum(&password);
+       gnutls_free(priv);
        return ret;
 }