From: Laurent Vivier Date: Thu, 17 Jul 2025 15:08:04 +0000 (+0200) Subject: net/passt: Initialize "error" variable in net_passt_send() (CID 1612368) X-Git-Tag: v10.1.0-rc0~8^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=667ad57b7636881eb79b0b319951f3cba9bbf27e;p=thirdparty%2Fqemu.git net/passt: Initialize "error" variable in net_passt_send() (CID 1612368) This was flagged by Coverity as a memory illegal access. Initialize the pointer to NULL at declaration. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Signed-off-by: Jason Wang --- diff --git a/net/passt.c b/net/passt.c index 43c336e596..32ecffb763 100644 --- a/net/passt.c +++ b/net/passt.c @@ -124,7 +124,7 @@ static gboolean net_passt_send(QIOChannel *ioc, GIOCondition condition, { if (net_stream_data_send(ioc, condition, data) == G_SOURCE_REMOVE) { NetPasstState *s = DO_UPCAST(NetPasstState, data, data); - Error *error; + Error *error = NULL; /* we need to restart passt */ kill(s->pid, SIGTERM);