qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-stable] [PATCH 3/3] savevm: avoid leaking popen(3


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [Qemu-stable] [PATCH 3/3] savevm: avoid leaking popen(3) file pointer
Date: Wed, 12 Jun 2013 09:16:57 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Jun 11, 2013 at 05:59:31PM -0500, mdroth wrote:
> On Thu, May 30, 2013 at 04:14:46PM +0200, Stefan Hajnoczi wrote:
> > I'm not sure why we check the mode only after invoking popen(3) but we
> > need to close the file pointer.
> > 
> > Spotted by Coverity.
> > 
> > Cc: Juan Quintela <address@hidden>
> > Cc: address@hidden
> > Signed-off-by: Stefan Hajnoczi <address@hidden>
> 
> Ping, looking to get this in for 1.5.1
> 
> > ---
> >  savevm.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/savevm.c b/savevm.c
> > index 31dcce9..75cc72e 100644
> > --- a/savevm.c
> > +++ b/savevm.c
> > @@ -329,6 +329,7 @@ QEMUFile *qemu_popen_cmd(const char *command, const 
> > char *mode)
> > 
> >      if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 
> > 0) {
> >          fprintf(stderr, "qemu_popen: Argument validity check failed\n");
> > +        fclose(stdio_file);
> >          return NULL;
> >      }

The v2 I sent had Patch 1 picked up by Paolo and Patch 2 is not yet
merged by anyone.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]