You need to sign in or sign up before continuing.
  • A
    tests: avoid memory leak on testTLSSessionInit · 3a89819d
    Alex Jia 提交于
    * tests/virnettlscontexttest: fix memory leak on virnettlscontext test case.
    
    * Detected in valgrind run:
    
    ==25667==
    ==25667== 86,651 (34,680 direct, 51,971 indirect) bytes in 10 blocks are
    definitely lost in loss record 350 of 351
    ==25667==    at 0x4005447: calloc (vg_replace_malloc.c:467)
    ==25667==    by 0x4F1F515D: gnutls_init (gnutls_state.c:270)
    ==25667==    by 0x8053432: virNetTLSSessionNew (virnettlscontext.c:1181)
    ==25667==    by 0x804DD24: testTLSSessionInit (virnettlscontexttest.c:624)
    ==25667==    by 0x804F14D: virtTestRun (testutils.c:140)
    ==25667==
    ==25667== 100,578 (38,148 direct, 62,430 indirect) bytes in 11 blocks are
    definitely lost in loss record 351 of 351
    ==25667==    at 0x4005447: calloc (vg_replace_malloc.c:467)
    ==25667==    by 0x4F1F515D: gnutls_init (gnutls_state.c:270)
    ==25667==    by 0x8053432: virNetTLSSessionNew (virnettlscontext.c:1181)
    ==25667==    by 0x804DD3C: testTLSSessionInit (virnettlscontexttest.c:625)
    ==25667==    by 0x804F14D: virtTestRun (testutils.c:140)
    
    * How to reproduce?
    % cd libvirt && ./configure && make && make -C tests valgrind
    or
    % valgrind -v --leak-check=full ./tests/virnettlscontexttest
    Signed-off-by: NAlex Jia <ajia@redhat.com>
    3a89819d
virnettlscontexttest.c 42.4 KB