From: Pan Nengyuan <[email protected]> Missing g_error_free on error path in ga_channel_write_all(). Fix that.
Reported-by: Euler Robot <[email protected]> Signed-off-by: Pan Nengyuan <[email protected]> Reviewed-by: Li Qiang <[email protected]> Signed-off-by: Chen Qun <[email protected]> --- Cc: Michael Roth <[email protected]> --- qga/channel-posix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qga/channel-posix.c b/qga/channel-posix.c index 0373975360..8f3821af6d 100644 --- a/qga/channel-posix.c +++ b/qga/channel-posix.c @@ -249,7 +249,7 @@ GIOStatus ga_channel_write_all(GAChannel *c, const gchar *buf, gsize size) buf += written; } else if (status != G_IO_STATUS_AGAIN) { g_warning("error writing to channel: %s", err->message); - return status; + goto out; } } @@ -261,6 +261,10 @@ GIOStatus ga_channel_write_all(GAChannel *c, const gchar *buf, gsize size) g_warning("error flushing channel: %s", err->message); } +out: + if (err) { + g_error_free(err); + } return status; } -- 2.23.0
