From: John Darrington Date: Sun, 15 Aug 2010 08:58:32 +0000 (+0200) Subject: Fix bug reallocating sourceview path array X-Git-Tag: v0.7.9~159^2~3 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5418debea5287aa2e9c49d99c26e6e1f40788dd4;p=pspp-builds.git Fix bug reallocating sourceview path array --- diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index 436830c3..68c1546e 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -114,7 +114,7 @@ psppire_syntax_window_class_init (PsppireSyntaxWindowClass *class) gchar **new_paths = g_strdupv ((gchar **)existing_paths); int n = g_strv_length ((gchar **) existing_paths); - new_paths = g_realloc (new_paths, (n + 1) * sizeof (*new_paths)); + new_paths = g_realloc (new_paths, (n + 2) * sizeof (*new_paths)); new_paths[n] = g_strdup (relocate (PKGDATADIR)); new_paths[n+1] = NULL;