我运行 valgrind 来查看我的程序在内存问题方面有哪些错误。valgrind 的输出是:
==31041== 17,736 bytes in 1 blocks are still reachable in loss record 423 of 423
==31041== at 0x4C2CD7B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31041== by 0x5B0F21F: CRYPTO_malloc (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==31041== by 0x5874B12: ??? (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
==31041== by 0x5874C68: ??? (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
==31041== by 0x586DE5B: ??? (in /lib/x86_64-linux-gnu/libssl.so.1.0.0)
==31041== by 0x4E4FFEA: ??? (in /usr/lib/libpq.so.5.4)
==31041== by 0x4E40AB5: PQconnectPoll (in /usr/lib/libpq.so.5.4)
==31041== by 0x4E41F4D: ??? (in /usr/lib/libpq.so.5.4)
==31041== by 0x4E428FE: PQconnectdb (in /usr/lib/libpq.so.5.4)
==31041== by 0x401D18: open_connection (database.c:23)
==31041== by 0x402A78: init (kernel.c:28)
==31041== by 0x402E9C: main (main.c:22)
90%的错误,都是关于这个的!
有人知道如何解决这个问题吗?