Skip to content
  • Pan Nengyuan's avatar
    88be15a9
    throttle-groups: fix memory leak in throttle_group_set_limit: · 88be15a9
    Pan Nengyuan authored
    
    
    This avoid a memory leak when qom-set is called to set throttle_group
    limits, here is an easy way to reproduce:
    
    1. run qemu-iotests as follow and check the result with asan:
           ./check -qcow2 184
    
    Following is the asan output backtrack:
    Direct leak of 912 byte(s) in 3 object(s) allocated from:
        #0 0xffff8d7ab3c3 in __interceptor_calloc   (/lib64/libasan.so.4+0xd33c3)
        #1 0xffff8d4c31cb in g_malloc0   (/lib64/libglib-2.0.so.0+0x571cb)
        #2 0x190c857 in qobject_input_start_struct  /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qapi/qobject-input-visitor.c:295
        #3 0x19070df in visit_start_struct   /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qapi/qapi-visit-core.c:49
        #4 0x1948b87 in visit_type_ThrottleLimits   qapi/qapi-visit-block-core.c:3759
        #5 0x17e4aa3 in throttle_group_set_limits   /mnt/sdc/qemu-master/qemu-4.2.0-rc0/block/throttle-groups.c:900
        #6 0x1650eff in object_property_set     /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qom/object.c:1272
        #7 0x1658517 in object_property_set_qobject   /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qom/qom-qobject.c:26
        #8 0x15880bb in qmp_qom_set  /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qom/qom-qmp-cmds.c:74
        #9 0x157e3e3 in qmp_marshal_qom_set  qapi/qapi-commands-qom.c:154
    
    Reported-by: default avatarEuler Robot <euler.robot@huawei.com>
    Signed-off-by: default avatarPanNengyuan <pannengyuan@huawei.com>
    Message-id: 1574835614-42028-1-git-send-email-pannengyuan@huawei.com
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    88be15a9
    throttle-groups: fix memory leak in throttle_group_set_limit:
    Pan Nengyuan authored
    
    
    This avoid a memory leak when qom-set is called to set throttle_group
    limits, here is an easy way to reproduce:
    
    1. run qemu-iotests as follow and check the result with asan:
           ./check -qcow2 184
    
    Following is the asan output backtrack:
    Direct leak of 912 byte(s) in 3 object(s) allocated from:
        #0 0xffff8d7ab3c3 in __interceptor_calloc   (/lib64/libasan.so.4+0xd33c3)
        #1 0xffff8d4c31cb in g_malloc0   (/lib64/libglib-2.0.so.0+0x571cb)
        #2 0x190c857 in qobject_input_start_struct  /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qapi/qobject-input-visitor.c:295
        #3 0x19070df in visit_start_struct   /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qapi/qapi-visit-core.c:49
        #4 0x1948b87 in visit_type_ThrottleLimits   qapi/qapi-visit-block-core.c:3759
        #5 0x17e4aa3 in throttle_group_set_limits   /mnt/sdc/qemu-master/qemu-4.2.0-rc0/block/throttle-groups.c:900
        #6 0x1650eff in object_property_set     /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qom/object.c:1272
        #7 0x1658517 in object_property_set_qobject   /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qom/qom-qobject.c:26
        #8 0x15880bb in qmp_qom_set  /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qom/qom-qmp-cmds.c:74
        #9 0x157e3e3 in qmp_marshal_qom_set  qapi/qapi-commands-qom.c:154
    
    Reported-by: default avatarEuler Robot <euler.robot@huawei.com>
    Signed-off-by: default avatarPanNengyuan <pannengyuan@huawei.com>
    Message-id: 1574835614-42028-1-git-send-email-pannengyuan@huawei.com
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Loading