]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
net/passt: Initialize "error" variable in net_passt_send() (CID 1612368)
authorLaurent Vivier <lvivier@redhat.com>
Thu, 17 Jul 2025 15:08:04 +0000 (17:08 +0200)
committerJason Wang <jasowang@redhat.com>
Mon, 21 Jul 2025 02:23:03 +0000 (10:23 +0800)
This was flagged by Coverity as a memory illegal access.

Initialize the pointer to NULL at declaration.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/passt.c

index 43c336e5968c8c1eb15d942eb2ae0a9e0dce50bb..32ecffb763b48af4e17b20b98537a4ffb3a6d3ea 100644 (file)
@@ -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);