From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmXXU-0000RJ-3x for qemu-devel@nongnu.org; Tue, 11 Jun 2013 18:59:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmXXS-0003K2-Qd for qemu-devel@nongnu.org; Tue, 11 Jun 2013 18:59:43 -0400 Sender: fluxion Date: Tue, 11 Jun 2013 17:59:31 -0500 From: mdroth Message-ID: <20130611225931.GE12585@vm> References: <1369923286-22260-1-git-send-email-stefanha@redhat.com> <1369923286-22260-4-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1369923286-22260-4-git-send-email-stefanha@redhat.com> 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: Stefan Hajnoczi Cc: Markus Armbruster , Juan Quintela , qemu-devel@nongnu.org, qemu-stable@nongnu.org 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; > } > > -- > 1.8.1.4 > >