From ad98bb1fda2b32c26b03e3025e429e0d437df846 Mon Sep 17 00:00:00 2001 From: Marijn van Vliet Date: Fri, 5 Jun 2009 10:27:38 +0000 Subject: [PATCH] Fixed crash in FreeBSD. There was no reason to assume the argument list would be null terminated. git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@98 ddfedd41-794f-dd11-ae45-00112f111e67 --- libchimara/chimara-glk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c index 00cc8b4..bf0e60b 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -995,9 +995,9 @@ chimara_glk_run(ChimaraGlk *glk, gchar *plugin, int argc, char *argv[], GError * startup_succeeded = glkunix_startup_code(&data); priv->in_startup = FALSE; - gchar **ptr = data.argv; - while(*ptr++) - g_free(*ptr); + int i=0; + while(i < data.argc) + g_free(data.argv[i++]); g_free(data.argv); if(!startup_succeeded) -- 2.30.2