On Thu, Jul 9, 2026 at 7:13 PM <[email protected]> wrote: > > From: Marc-André Lureau <[email protected]> > > 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 <[email protected]>
Looks good to me. Are you working for filter-rewriter's qom-test? There is no place in the current implementation where this issue would be triggered. Reviewed-by: Zhang Chen <[email protected]> > --- > net/filter-rewriter.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c > index cdf85aa5eed..c85d180eb96 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) > -- > 2.55.0 >
