diff options
author | Frediano Ziglio <freddy77@gmail.com> | 2020-10-20 08:42:46 +0100 |
---|---|---|
committer | Frediano Ziglio <freddy77@gmail.com> | 2020-10-21 16:08:22 +0100 |
commit | aab670b3b705c8d6d870e12efd1cdfe2eaf41aeb (patch) | |
tree | 6422e934dad14d5b561f384f8c29a81de4a683f2 | |
parent | e73e330e9954e18221a74171a2b9213e4cb0d077 (diff) |
vdagentd: Simplify handling VD_AGENT_GRAPHICS_DEVICE_INFO
g_free does nothing if pointer is NULL.
device_info and device_info_size will be overwritten in any case.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@redhat.com>
-rw-r--r-- | src/vdagentd/vdagentd.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c index 1f8b474..9444c32 100644 --- a/src/vdagentd/vdagentd.c +++ b/src/vdagentd/vdagentd.c @@ -606,12 +606,8 @@ static void virtio_port_read_complete( break; } case VD_AGENT_GRAPHICS_DEVICE_INFO: { - if (device_info) { - g_free(device_info); - device_info = NULL; - device_info_size = 0; - } // store device info for re-sending when a session agent reconnects + g_free(device_info); device_info = g_memdup(data, message_header->size); device_info_size = message_header->size; forward_data_to_session_agent(VDAGENTD_GRAPHICS_DEVICE_INFO, data, message_header->size); |