summaryrefslogtreecommitdiffstats
path: root/replay
diff options
context:
space:
mode:
authorMarkus Armbruster2022-09-23 11:04:28 +0200
committerLaurent Vivier2022-10-04 00:10:11 +0200
commit76eb88b12baf2bd9a1729ded33bd58b7da5d7ec3 (patch)
treec43a4a4027d2374c0918dac0dce7bd60be676c1b /replay
parentblock/qcow2-bitmap: Add missing cast to silent GCC error (diff)
downloadqemu-76eb88b12baf2bd9a1729ded33bd58b7da5d7ec3.tar.gz
qemu-76eb88b12baf2bd9a1729ded33bd58b7da5d7ec3.tar.xz
qemu-76eb88b12baf2bd9a1729ded33bd58b7da5d7ec3.zip
Drop superfluous conditionals around g_free()
There is no need to guard g_free(P) with if (P): g_free(NULL) is safe. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220923090428.93529-1-armbru@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'replay')
-rw-r--r--replay/replay.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/replay/replay.c b/replay/replay.c
index 4c396bb376..9a0dc1cf44 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -366,10 +366,8 @@ void replay_finish(void)
fclose(replay_file);
replay_file = NULL;
}
- if (replay_filename) {
- g_free(replay_filename);
- replay_filename = NULL;
- }
+ g_free(replay_filename);
+ replay_filename = NULL;
g_free(replay_snapshot);
replay_snapshot = NULL;