Received: from eggs.gnu.org ([2001:4830:134:3::10]:42699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZADSZ-0000kR-9y for qemu-devel@nongnu.org; Wed, 01 Jul 2015 04:33:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZADSV-0007Hj-4s for qemu-devel@nongnu.org; Wed, 01 Jul 2015 04:33:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZADSU-0007Hf-W3 for qemu-devel@nongnu.org; Wed, 01 Jul 2015 04:33:31 -0400 From: Juan Quintela In-Reply-To: <1434986319-22294-1-git-send-email-dgilbert@redhat.com> (David Alan Gilbert's message of "Mon, 22 Jun 2015 16:18:39 +0100") References: <1434986319-22294-1-git-send-email-dgilbert@redhat.com> Date: Wed, 01 Jul 2015 10:33:23 +0200 Message-ID: <87616446r0.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] RDMA: Missing free in (probably unreachable) error path Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: amit.shah@redhat.com, qemu-devel@nongnu.org, mrhines@us.ibm.com "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > Coverity CID 1307773 > > Signed-off-by: Dr. David Alan Gilbert Integrated gonglei patch for this, just moved the malloc. > --- > migration/rdma.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/migration/rdma.c b/migration/rdma.c > index 53e611e..2a9e0ce 100644 > --- a/migration/rdma.c > +++ b/migration/rdma.c > @@ -3395,6 +3395,7 @@ static void *qemu_fopen_rdma(RDMAContext *rdma, const char *mode) > QEMUFileRDMA *r = g_malloc0(sizeof(QEMUFileRDMA)); > > if (qemu_file_mode_is_not_valid(mode)) { > + g_free(r); > return NULL; > }