]> sourceware.org Git - lvm2.git/commit
lvmetad: fix heap memory leak
authorwangjufeng <wangjufeng@huawei.com>
Wed, 5 Feb 2020 05:39:39 +0000 (13:39 +0800)
committerDavid Teigland <teigland@redhat.com>
Wed, 5 Feb 2020 21:30:17 +0000 (15:30 -0600)
commitbcf9556b8fcd16ad8997f80cc92785f295c66701
tree023dde37c89fc49ef5794fb3a68c1696fd1e6cc5
parenta1f06e2faebfbc091b4bbb900398cda05264c753
lvmetad: fix heap memory leak

error could be reproduced by calling pvs periodically:
    #!/bin/bash
    while :
    do
        pvs
        sleep 1
    done

use top command to watch RES memory of lvmetad. After a few minutes,
its RES memory will grow for a few KB. Then stop calling pvs, while
its RES will not decrease.

This is because, when lvmetad make reponse for clent request, it
will malloc new chunk for s->vgid_to_metadata, while actually the
new chunk should be added to the reponse dm_config_tree, or it will
make the chunk list of s->vgid_to_metadata keep growing.

Signed-off-by: wangjufeng <wangjufeng@huawei.com>
Reviewed-by: liuzhiqiang <liuzhiqiang26@huawei.com>
Reviewed-by: guiyao <guiyao@huawei.com>
daemons/lvmetad/lvmetad-core.c
This page took 0.030368 seconds and 5 git commands to generate.