Message ID | 1434986319-22294-1-git-send-email-dgilbert@redhat.com |
---|---|
State | New |
Headers | show |
Am 22.06.2015 um 17:18 schrieb Dr. David Alan Gilbert (git): > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com> > > Coverity CID 1307773 > > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Regards, Andreas
"Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> wrote: > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com> > > Coverity CID 1307773 > > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> 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; > }
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; }