From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmfIq-000749-Ox for qemu-devel@nongnu.org; Wed, 12 Jun 2013 03:17:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmfIk-0006H7-7y for qemu-devel@nongnu.org; Wed, 12 Jun 2013 03:17:08 -0400 Date: Wed, 12 Jun 2013 09:16:57 +0200 From: Stefan Hajnoczi Message-ID: <20130612071657.GB867@stefanha-thinkpad.muc.redhat.com> References: <1369923286-22260-1-git-send-email-stefanha@redhat.com> <1369923286-22260-4-git-send-email-stefanha@redhat.com> <20130611225931.GE12585@vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130611225931.GE12585@vm> Subject: Re: [Qemu-devel] [Qemu-stable] [PATCH 3/3] savevm: avoid leaking popen(3) file pointer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mdroth Cc: Markus Armbruster , Juan Quintela , qemu-devel@nongnu.org, qemu-stable@nongnu.org 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 > > Cc: qemu-stable@nongnu.org > > Signed-off-by: Stefan Hajnoczi > > 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