You need to sign in or sign up before continuing.
  • A
    remote: Fix memory leak · 7518ad75
    Alex Jia 提交于
    Detected in valgrind run:
    
    ==9184== 1 bytes in 1 blocks are definitely lost in loss record 1 of 19
    ==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
    ==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
    ==9184==    by 0x4CF97C9: xdr_remote_domain_get_security_label_ret (remote_protocol.c:1696)
    ==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
    ==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
    ==9184==    by 0x4CE3887: call (remote_driver.c:3933)
    ==9184==    by 0x4CF71C6: remoteDomainGetSecurityLabel (remote_driver.c:1580)
    ==9184==    by 0x4CCA480: virDomainGetSecurityLabel (libvirt.c:7340)
    ==9184==    by 0x41993A: cmdDominfo (virsh.c:2414)
    ==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
    ==9184==    by 0x4211ED: main (virsh.c:14076)
    ==9184==
    ==9184== 2 bytes in 1 blocks are definitely lost in loss record 2 of 19
    ==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
    ==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
    ==9184==    by 0x4CF974F: xdr_remote_node_get_security_model_ret (remote_protocol.c:1713)
    ==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
    ==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
    ==9184==    by 0x4CE3887: call (remote_driver.c:3933)
    ==9184==    by 0x4CF6F96: remoteNodeGetSecurityModel (remote_driver.c:1648)
    ==9184==    by 0x4CBF799: virNodeGetSecurityModel (libvirt.c:7382)
    ==9184==    by 0x4197D7: cmdDominfo (virsh.c:2394)
    ==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
    ==9184==    by 0x4211ED: main (virsh.c:14076)
    ==9184==
    ==9184== 8 bytes in 1 blocks are definitely lost in loss record 3 of 19
    ==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
    ==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
    ==9184==    by 0x4CF9729: xdr_remote_node_get_security_model_ret (remote_protocol.c:1710)
    ==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
    ==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
    ==9184==    by 0x4CE3887: call (remote_driver.c:3933)
    ==9184==    by 0x4CF6F96: remoteNodeGetSecurityModel (remote_driver.c:1648)
    ==9184==    by 0x4CBF799: virNodeGetSecurityModel (libvirt.c:7382)
    ==9184==    by 0x4197D7: cmdDominfo (virsh.c:2394)
    ==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
    ==9184==    by 0x4211ED: main (virsh.c:14076)
    ==9184==
    ==9184== LEAK SUMMARY:
    ==9184==    definitely lost: 11 bytes in 3 blocks
    
    * src/remote/remote_driver.c: Avoid leak on remoteDomainGetSecurityLabel
      and remoteNodeGetSecurityModel.
    7518ad75
remote_driver.c 141.1 KB