[gnutls-devel] GnuTLS | Tests: Memory leak in pkcs11/long-label.c (missing gnutls_free ) (#1799)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Wed Feb 18 14:35:26 CET 2026



Conor Tull created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1799



In `tests/pkcs11/long-label.c`, the test iterates through tokens using `gnutls_pkcs11_token_get_url()`.

According to the documentation (https://man7.org/linux/man-pages/man3/gnutls_pkcs11_token_get_url.3.html) , `gnutls_pkcs11_token_get_url` allocates memory for the `url` string which must be released using **`gnutls_free()`**.

Currently, the loop checks the content and continues to the next iteration if it doesn't match the target, overwriting the pointer and leaking the memory allocated in the previous iteration.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1799
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20260218/da414988/attachment.html>


More information about the Gnutls-devel mailing list