From: Marijn van Vliet Date: Fri, 5 Jun 2009 10:27:38 +0000 (+0000) Subject: Fixed crash in FreeBSD. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=ad98bb1fda2b32c26b03e3025e429e0d437df846;p=rodin%2Fchimara.git 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 --- 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)