[gnutls-devel] GnuTLS | Fix memleak in 'iov_store_grow' (!1277)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Fri Jun 5 09:06:55 CEST 2020



Merge request https://gitlab.com/gnutls/gnutls/-/merge_requests/1277 was reviewed by Daiki Ueno

--
  
Daiki Ueno started a new discussion on lib/crypto-api.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1277#note_355871909

>  		s->data = gnutls_realloc(s->data, s->size);

This is an issue in the original code, but `s->data` will leak if `gnutls_realloc` fails. Maybe good to rewrite it to something like:
```c
void *data;
[...]
data = gnutls_realloc(s->data, s->size);
if (data == NULL)
	return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
s->data = data;
```


-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1277
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/20200605/f3067a2b/attachment.html>


More information about the Gnutls-devel mailing list