Fix bug reallocating sourceview path array
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 15 Aug 2010 08:58:32 +0000 (10:58 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 15 Aug 2010 08:58:32 +0000 (10:58 +0200)
src/ui/gui/psppire-syntax-window.c

index 436830c320a73e761ca9dca07d7ab4f5a57c1538..68c1546ed39cc9bf1227c7008d56806343dd6ebf 100644 (file)
@@ -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;