From: rodin Date: Fri, 5 Jun 2009 10:27:38 +0000 (+0000) Subject: Fixed crash in FreeBSD. X-Git-Tag: v0.9~367 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=7cd0a68f04723b799fcaf075c94aa289be9dde52;p=projects%2Fchimara%2Fchimara.git Fixed crash in FreeBSD. There was no reason to assume the argument list would be null terminated. --- 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)