[PATCH] fixup! replay: Record allocations in a GList to handle errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 server/red-replay-qxl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
index 7eddaf4..9c3df70 100644
--- a/server/red-replay-qxl.c
+++ b/server/red-replay-qxl.c
@@ -1220,7 +1220,7 @@ SPICE_GNUC_VISIBLE QXLCommandExt* spice_replay_next_cmd(SpiceReplay *replay,
             replay_handle_dev_input(worker, replay, type);
         }
     }
-    cmd = g_new(QXLCommandExt, 1);
+    cmd = replay_malloc0(replay, sizeof(QXLCommandExt));
     cmd->cmd.type = type;
     cmd->group_id = 0;
     spice_debug("command %"PRIu64", %d\r", timestamp, cmd->cmd.type);
@@ -1275,9 +1275,6 @@ error:
         g_list_free_full(replay->allocated, free);
         replay->allocated = NULL;
     }
-    if (cmd) {
-        g_free(cmd);
-    }
     return NULL;
 }
 
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]