"Dr. David Alan Gilbert (git)" <dgilb...@redhat.com> wrote: > From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> > > Coverity CID 1307773 > > Signed-off-by: Dr. David Alan Gilbert <dgilb...@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; > }