From b94aaf81d04f87cfcfde76b68876fbc0d27a8deb Mon Sep 17 00:00:00 2001 From: Scott Balneaves Date: Mon, 12 Nov 2012 08:54:33 -0600 Subject: Code audit: fix compile warnings, uninitialized pointer problems --- mate-panel/libpanel-util/panel-launch.c | 17 ++++++++++------- mate-panel/libpanel-util/panel-show.c | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'mate-panel/libpanel-util') diff --git a/mate-panel/libpanel-util/panel-launch.c b/mate-panel/libpanel-util/panel-launch.c index af2b4282..5479daaa 100644 --- a/mate-panel/libpanel-util/panel-launch.c +++ b/mate-panel/libpanel-util/panel-launch.c @@ -58,13 +58,10 @@ _panel_launch_handle_error (const gchar *name, GError *local_error, GError **error) { - if (local_error == NULL) - return TRUE; - - else if (g_error_matches (local_error, - G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_error_free (local_error); - return TRUE; + if (g_error_matches (local_error, + G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + g_error_free (local_error); + return TRUE; } else if (error != NULL) @@ -104,6 +101,9 @@ panel_app_info_launch_uris (GAppInfo *appinfo, g_object_unref (context); + if ((local_error == NULL) && (retval == TRUE)) + return TRUE; + return _panel_launch_handle_error (g_app_info_get_name (appinfo), screen, local_error, error); } @@ -229,6 +229,9 @@ panel_launch_desktop_file_with_fallback (const char *desktop_file, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &local_error); + if (local_error == NULL && retval == TRUE) + return TRUE; + return _panel_launch_handle_error (fallback_exec, screen, local_error, error); } diff --git a/mate-panel/libpanel-util/panel-show.c b/mate-panel/libpanel-util/panel-show.c index 02ea2e63..5100be88 100644 --- a/mate-panel/libpanel-util/panel-show.c +++ b/mate-panel/libpanel-util/panel-show.c @@ -141,8 +141,8 @@ static gboolean _panel_show_handle_error(const gchar* uri, GdkScreen* screen, GE static gboolean panel_show_caja_search_uri(GdkScreen* screen, const gchar* uri, guint32 timestamp, GError** error) { - char* desktopfile; - GDesktopAppInfo* appinfo; + char* desktopfile = NULL; + GDesktopAppInfo* appinfo = NULL; gboolean ret; desktopfile = panel_g_lookup_in_applications_dirs("caja-folder-handler.desktop"); -- cgit v1.2.1