Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ui/gtk: fix leaks found wtih fuzzing
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: 060ab76 ("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>
  • Loading branch information
Dmitry Frolov authored and elmarco committed Sep 4, 2023
1 parent 8784909 commit e38f4e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/gtk.c
Expand Up @@ -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;
Expand All @@ -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();
Expand Down

0 comments on commit e38f4e9

Please sign in to comment.