[libegg] smclient: Correctly free GPtrArray to avoid crash

commit f86bcc073230462f1918c1df015b48e4ef223c1e
Author: Petr Gajdůšek <gajdusek petr centrum cz>
Date:   Mon Jun 29 23:45:28 2009 +0200

    smclient: Correctly free GPtrArray to avoid crash
    The code was assuming that a NULL element was added at the end of the
    GPtrArray, which was not always the case for failures.
    This is the end of http://bugzilla.gnome.org/show_bug.cgi?id=547443

 libegg/smclient/eggdesktopfile.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libegg/smclient/eggdesktopfile.c b/libegg/smclient/eggdesktopfile.c
index af8a98e..6f6b946 100644
--- a/libegg/smclient/eggdesktopfile.c
+++ b/libegg/smclient/eggdesktopfile.c
@@ -1274,8 +1274,8 @@ egg_desktop_file_launchv (EggDesktopFile *desktop_file,
   if (env)
-      g_strfreev ((char **)env->pdata);
-      g_ptr_array_free (env, FALSE);
+      g_ptr_array_foreach (env, (GFunc)g_free, NULL);
+      g_ptr_array_free (env, TRUE);
   free_document_list (translated_documents);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]