[libvirt] [PATCH] cgroup: Fix possible memory leak in virCgroupMakeGroup

Eric Blake eblake at redhat.com
Mon May 3 21:03:03 UTC 2010


On 05/03/2010 01:04 PM, Ryota Ozaki wrote:
> * src/util/cgroup.c: free temporal path string before breaking loop
> ---
>  src/util/cgroup.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/src/util/cgroup.c b/src/util/cgroup.c
> index b649c3c..b8b2eb5 100644
> --- a/src/util/cgroup.c
> +++ b/src/util/cgroup.c
> @@ -472,8 +472,10 @@ static int virCgroupMakeGroup(virCgroupPtr parent, virCgroupPtr group, int creat
>                  (i == VIR_CGROUP_CONTROLLER_CPUSET ||
>                   STREQ(group->controllers[i].mountPoint, group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint))) {
>                  rc = virCgroupCpuSetInherit(parent, group);
> -                if (rc != 0)
> +                if (rc != 0) {
> +                    VIR_FREE(path);
>                      break;
> +                }

ACK, after reading the entire function.  I've pushed this commit; thanks
again.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100503/ba6690f4/attachment-0001.sig>


More information about the libvir-list mailing list