Re: [libvirt] [PATCH] cgroup: avoid leaking a file

2011-05-04 Thread Laine Stump
On 05/04/2011 10:40 AM, Eric Blake wrote: On 05/04/2011 06:23 AM, Laine Stump wrote: This definitely fixes the FILE* leak, but do we really want to abort the loop (stop looking for more pidfiles) when fscanf fails on one pidfile? (dunno, just asking) Personally, I think that since pidfiles are

Re: [libvirt] [PATCH] cgroup: avoid leaking a file

2011-05-04 Thread Eric Blake
On 05/04/2011 06:23 AM, Laine Stump wrote: >>> This definitely fixes the FILE* leak, but do we really want to abort >>> the loop (stop looking for more pidfiles) when fscanf fails on one >>> pidfile? (dunno, just asking) Personally, I think that since pidfiles are always generated by the kernel, t

Re: [libvirt] [PATCH] cgroup: avoid leaking a file

2011-05-04 Thread Laine Stump
On 05/04/2011 03:35 AM, Daniel Veillard wrote: On Wed, May 04, 2011 at 12:30:07AM -0400, Laine Stump wrote: On 05/03/2011 05:49 PM, Eric Blake wrote: Clang detected a dead store to rc. It turns out that in fixing this, I also found a FILE* leak. * src/util/cgroup.c (virCgroupKillInternal): Ab

Re: [libvirt] [PATCH] cgroup: avoid leaking a file

2011-05-04 Thread Daniel Veillard
On Wed, May 04, 2011 at 12:30:07AM -0400, Laine Stump wrote: > On 05/03/2011 05:49 PM, Eric Blake wrote: > >Clang detected a dead store to rc. It turns out that in fixing this, > >I also found a FILE* leak. > > > >* src/util/cgroup.c (virCgroupKillInternal): Abort rather than > >resuming loop on f

Re: [libvirt] [PATCH] cgroup: avoid leaking a file

2011-05-03 Thread Laine Stump
On 05/03/2011 05:49 PM, Eric Blake wrote: Clang detected a dead store to rc. It turns out that in fixing this, I also found a FILE* leak. * src/util/cgroup.c (virCgroupKillInternal): Abort rather than resuming loop on fscanf failure, and cleanup file on error. This definitely fixes the FILE*

[libvirt] [PATCH] cgroup: avoid leaking a file

2011-05-03 Thread Eric Blake
Clang detected a dead store to rc. It turns out that in fixing this, I also found a FILE* leak. * src/util/cgroup.c (virCgroupKillInternal): Abort rather than resuming loop on fscanf failure, and cleanup file on error. --- As a bonus, this also fixes a decl-after-statement for fp. src/util/cgr