dump: Fix g_array_unref(NULL) in dump-guest-memory
commit96afbc571c91b115ba51d9740352a0e45111edc9
authorMarkus Armbruster <armbru@redhat.com>
Tue, 31 Oct 2023 10:45:28 +0000 (31 11:45 +0100)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 2 Nov 2023 14:40:50 +0000 (2 18:40 +0400)
tree784eb7c263ac29eb2efaba145ce55082b83969fc
parent8beaeed73496395f75a3e65191d45e0e299fb25b
dump: Fix g_array_unref(NULL) in dump-guest-memory

When dump_init()'s check for non-zero @length fails, dump_cleanup()
passes null s->string_table_buf to g_array_unref(), which spews "GLib:
g_array_unref: assertion 'array' failed" to stderr.

Guard the g_array_unref().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20231031104531.3169721-3-armbru@redhat.com>
dump/dump.c