[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 52/52] ui/gtk: fix leaks found wtih fuzzing
From: |
marcandre . lureau |
Subject: |
[PULL 52/52] ui/gtk: fix leaks found wtih fuzzing |
Date: |
Mon, 4 Sep 2023 15:52:49 +0400 |
From: Dmitry Frolov <frolov@swemel.ru>
It is true, that there is no problem during runtime
from the first sight, because the memory is lost just
before qemu exits. Nevertheless, this change is necessary,
because AddressSanitizer is not able to recognize this
situation and produces crash-report (which is
false-positive in fact). Lots of False-Positive warnings
are davaluing problems, found with fuzzing, and thus the
whole methodology of dynamic analysis.
This patch eliminates such False-Positive reports,
and makes every problem, found with fuzzing, more valuable.
Fixes: 060ab76356 ("gtk: don't exit early in case gtk init fails")
Signed-off-by: Dmitry Frolov <frolov@swemel.ru>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Message-Id: <20230825115818.1091936-1-frolov@swemel.ru>
---
ui/gtk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index c34c133550..a14d56168d 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2359,7 +2359,7 @@ static void gtk_display_init(DisplayState *ds,
DisplayOptions *opts)
{
VirtualConsole *vc;
- GtkDisplayState *s = g_malloc0(sizeof(*s));
+ GtkDisplayState *s;
GdkDisplay *window_display;
GtkIconTheme *theme;
char *dir;
@@ -2369,6 +2369,7 @@ static void gtk_display_init(DisplayState *ds,
DisplayOptions *opts)
exit(1);
}
assert(opts->type == DISPLAY_TYPE_GTK);
+ s = g_malloc0(sizeof(*s));
s->opts = opts;
theme = gtk_icon_theme_get_default();
--
2.41.0
- [PULL 43/52] ui/vc: do not parse VC-specific options in Spice and GTK, (continued)
- [PULL 43/52] ui/vc: do not parse VC-specific options in Spice and GTK, marcandre . lureau, 2023/09/04
- [PULL 42/52] ui/vc: move text console invalidate in helper, marcandre . lureau, 2023/09/04
- [PULL 44/52] ui/vc: change the argument for QemuTextConsole, marcandre . lureau, 2023/09/04
- [PULL 45/52] ui/spice-display: Avoid dynamic stack allocation, marcandre . lureau, 2023/09/04
- [PULL 46/52] ui/vnc-enc-hextile: Use static rather than dynamic length stack array, marcandre . lureau, 2023/09/04
- [PULL 47/52] ui/vnc-enc-tight: Avoid dynamic stack allocation, marcandre . lureau, 2023/09/04
- [PULL 48/52] ui/dbus: Properly dispose touch/mouse dbus objects, marcandre . lureau, 2023/09/04
- [PULL 49/52] ui/dbus: implement damage regions for GL, marcandre . lureau, 2023/09/04
- [PULL 50/52] ui/vdagent: call vdagent_disconnect() when agent connection is lost, marcandre . lureau, 2023/09/04
- [PULL 51/52] ui/vdagent: Unregister input handler of mouse during finalization, marcandre . lureau, 2023/09/04
- [PULL 52/52] ui/gtk: fix leaks found wtih fuzzing,
marcandre . lureau <=
- Re: [PULL 00/52] UI patches, Stefan Hajnoczi, 2023/09/06