c - OpenSSL ASN1_item_ex_d2i 内存泄漏

标签 c sockets ssl memory-leaks openssl

我有一个 openSSL lib 问题,我有内存泄漏:

==9904== 
==9904== HEAP SUMMARY:
==9904==     in use at exit: 163,350 bytes in 2,867 blocks
==9904==   total heap usage: 5,104 allocs, 2,237 frees, 1,162,949 bytes allocated
==9904== 
==9904== 4,808 (184 direct, 4,624 indirect) bytes in 1 blocks are definitely lost in loss record 279 of 284
==9904==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==9904==    by 0x5106DFF: CRYPTO_malloc (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==9904==    by 0x51A27EB: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==9904==    by 0x51A517F: ASN1_item_ex_d2i (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==9904==    by 0x51A5BF3: ASN1_item_d2i (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==9904==    by 0x4E4789C: ??? (in /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0)
==9904==    by 0x4E48ED7: ??? (in /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0)
==9904==    by 0x4026BD: main (main.c:68)
==9904== 
==9904== LEAK SUMMARY:
==9904==    definitely lost: 184 bytes in 1 blocks
==9904==    indirectly lost: 4,624 bytes in 103 blocks
==9904==      possibly lost: 0 bytes in 0 blocks
==9904==    still reachable: 158,542 bytes in 2,763 blocks
==9904==         suppressed: 0 bytes in 0 blocks
==9904== Reachable blocks (those to which a pointer was found) are not shown.
==9904== To see them, rerun with: --leak-check=full --show-reachable=yes
==9904== 
==9904== For counts of detected and suppressed errors, rerun with: -v
==9904== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 8 from 6)

你知道这个问题吗?你能帮帮我吗?

罗曼 监督

最佳答案

您必须使用调试选项(即 ./config -d ...)重新编译 libssl.so.1.0.0 库才能追踪内存泄漏源

关于c - OpenSSL ASN1_item_ex_d2i 内存泄漏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20010711/

相关文章:

eclipse - Maven 依赖项仅在命令行下载,不在 Eclipse 中下载

ios - 使用 node-apn 发送 Push 总是返回 Invalid token (8)

c - 为什么 $(< file.txt) 不适用于 makefile?

c - 优化设置

mysql - 错误 2002 (HY000) : Can't connect to local MySQL server through socket '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock' (2) - XAMPP Mac OSX

C# 现有连接被远程主机强制关闭 : socket programming

ruby-on-rails - Net/IMAP SSL 错误,2.1.5 和 2.2.1,但 2.1.0 和 2.1.2 有效

c++ - 如何在项目中实现良好的调试/日志记录功能

c - void函数(C语言)

multithreading - python3 : two clients sending data to server using sockets