[gnutls-devel] GnuTLS | src/common.c: Move gnutls_free() out of out lable to avoid double free (!1966)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Sat May 31 01:31:08 CEST 2025




Daiki Ueno started a new discussion on src/common.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1966#note_2535579523

 >  	}
 >  	log_msg(stdout, "- Key material: %s\n", hex.data);
 >  	fflush(stdout);
 > +	gnutls_free(hex.data);
 >  
 >  out:
 >  	gnutls_free(bin.data);
 > -	gnutls_free(hex.data);

As `hex` is never allocated outside `gnutls_hex_encode2`, the original code shouldn't cause a double free; or am I missing something?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1966#note_2535579523
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/20250530/f3f2ae8b/attachment-0001.html>


More information about the Gnutls-devel mailing list