diff options
| author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2026-07-09 15:13:15 +0400 |
|---|---|---|
| committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2026-07-27 15:51:03 +0400 |
| commit | b28778131fad008fcb79204874d926c2433e518f (patch) | |
| tree | a4a37eb5f24f632194e1bf9304e2dcc266c19ec7 /net | |
| parent | 4727cc883b7e81d2c30b9801af54482d65b84292 (diff) | |
| download | qemu-b28778131fad008fcb79204874d926c2433e518f.tar.gz qemu-b28778131fad008fcb79204874d926c2433e518f.zip | |
net/colo: fix g_hash_table_destroy assertion on uninitialized filter
colo_rewriter_cleanup() unconditionally destroys connection_track_table,
but the table is only allocated in colo_rewriter_setup(). When the
filter-rewriter object is finalized without having been set up (e.g.
during qom-test property enumeration), the pointer is NULL and
g_hash_table_destroy() fires an assertion.
Use g_clear_pointer() to skip the destroy when the table was never
initialized.
Signed-off-by: Marc-Andre Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Zhang Chen <zhangckid@gmail.com>
Message-ID: <20260709111315.1108185-1-marcandre.lureau@redhat.com>
Diffstat (limited to 'net')
| -rw-r--r-- | net/filter-rewriter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c index cdf85aa5ee..c85d180eb9 100644 --- a/net/filter-rewriter.c +++ b/net/filter-rewriter.c @@ -373,7 +373,7 @@ static void colo_rewriter_cleanup(NetFilterState *nf) g_free(s->incoming_queue); } - g_hash_table_destroy(s->connection_track_table); + g_clear_pointer(&s->connection_track_table, g_hash_table_destroy); } static void colo_rewriter_setup(NetFilterState *nf, Error **errp) |
