diff options
-rw-r--r-- | migration/rdma.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/migration/rdma.c b/migration/rdma.c index b777273b59..0a00290160 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3263,12 +3263,13 @@ static const QEMUFileOps rdma_write_ops = { static void *qemu_fopen_rdma(RDMAContext *rdma, const char *mode) { - QEMUFileRDMA *r = g_malloc0(sizeof(QEMUFileRDMA)); + QEMUFileRDMA *r; if (qemu_file_mode_is_not_valid(mode)) { return NULL; } + r = g_malloc0(sizeof(QEMUFileRDMA)); r->rdma = rdma; if (mode[0] == 'w') { |