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 <lvivier@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
Laurent Vivier 2025-07-17 17:08:04 +02:00 committed by Jason Wang
parent f74e4f2e60
commit 667ad57b76

View 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);