[gnutls-devel] GnuTLS | serv: fix memleak when a connected client disappears (!1803)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Mon Jan 29 15:00:46 CET 2024




Hubert Kario (@mention me if you need reply) commented: https://gitlab.com/gnutls/gnutls/-/merge_requests/1803#note_1747717163

Looks good, with the patch:
```
==125397== HEAP SUMMARY:
==125397==     in use at exit: 110,969 bytes in 763 blocks
==125397==   total heap usage: 26,365 allocs, 25,602 frees, 114,356,937 bytes allocated
==125397== 
==125397== LEAK SUMMARY:
==125397==    definitely lost: 0 bytes in 0 blocks
==125397==    indirectly lost: 0 bytes in 0 blocks
==125397==      possibly lost: 0 bytes in 0 blocks
==125397==    still reachable: 110,969 bytes in 763 blocks
==125397==         suppressed: 0 bytes in 0 blocks
==125397== Reachable blocks (those to which a pointer was found) are not shown.
==125397== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==125397== 
==125397== For lists of detected and suppressed errors, rerun with: -s
==125397== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
```

Without the patch:
```
==155353== HEAP SUMMARY:
==155353==     in use at exit: 137,033 bytes in 1,125 blocks
==155353==   total heap usage: 26,372 allocs, 25,247 frees, 114,357,441 bytes allocated
==155353== 
==155353== 25,920 bytes in 360 blocks are definitely lost in loss record 78 of 79
==155353==    at 0x4849E60: calloc (vg_replace_malloc.c:1595)
==155353==    by 0x411DA8: xcalloc (xmalloc.c:298)
==155353==    by 0x4086C2: tcp_server (serv.c:1640)
==155353==    by 0x406BBB: main (serv.c:1467)
==155353== 
==155353== LEAK SUMMARY:
==155353==    definitely lost: 25,920 bytes in 360 blocks
==155353==    indirectly lost: 0 bytes in 0 blocks
==155353==      possibly lost: 0 bytes in 0 blocks
==155353==    still reachable: 111,113 bytes in 765 blocks
==155353==         suppressed: 0 bytes in 0 blocks
==155353== Reachable blocks (those to which a pointer was found) are not shown.
==155353== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==155353== 
==155353== For lists of detected and suppressed errors, rerun with: -s
==155353== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
```

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1803#note_1747717163
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/20240129/babb704c/attachment.html>


More information about the Gnutls-devel mailing list