[gnome-software] Coverity fixes
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Coverity fixes
- Date: Wed, 25 Mar 2015 19:25:18 +0000 (UTC)
commit 8f048abbe111bcd85588127e310f2e5f4d893be6
Author: Kalev Lember <kalevlember gmail com>
Date: Wed Mar 25 20:23:01 2015 +0100
Coverity fixes
Fix various issues pointed out by Coverity.
src/gs-cmd.c | 5 +++--
src/gs-folders.c | 4 ++--
src/gs-shell-updates.c | 1 +
src/plugins/gs-plugin-appstream.c | 2 ++
src/plugins/gs-plugin-moduleset.c | 3 ---
5 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/gs-cmd.c b/src/gs-cmd.c
index 931b6e7..da87a3a 100644
--- a/src/gs-cmd.c
+++ b/src/gs-cmd.c
@@ -339,8 +339,8 @@ main (int argc, char **argv)
}
} else if (argc == 2 && g_strcmp0 (argv[1], "get-categories") == 0) {
for (i = 0; i < repeat; i++) {
- if (list != NULL)
- gs_plugin_list_free (list);
+ if (categories != NULL)
+ gs_plugin_list_free (categories);
categories = gs_plugin_loader_get_categories (plugin_loader,
refine_flags,
NULL,
@@ -398,6 +398,7 @@ out:
gs_profile_dump (profile);
g_option_context_free (context);
gs_plugin_list_free (list);
+ gs_plugin_list_free (categories);
return status;
}
diff --git a/src/gs-folders.c b/src/gs-folders.c
index 0a15c90..ebb7ca2 100644
--- a/src/gs-folders.c
+++ b/src/gs-folders.c
@@ -391,14 +391,14 @@ gs_folders_remove_folder (GsFolders *folders, const gchar *id)
return;
g_hash_table_iter_init (&iter, folders->priv->apps);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer*)folder)) {
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer*)&folder)) {
if (folder && g_strcmp0 (id, folder->id) == 0) {
g_hash_table_iter_remove (&iter);
}
}
g_hash_table_iter_init (&iter, folders->priv->categories);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer*)folder)) {
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer*)&folder)) {
if (folder && g_strcmp0 (id, folder->id) == 0) {
g_hash_table_iter_remove (&iter);
}
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index fbd1e36..092272b 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -251,6 +251,7 @@ gs_shell_updates_update_ui_state (GsShellUpdates *shell_updates)
_("Setting up updates…"),
_("(This could take a while)"));
gtk_label_set_label (GTK_LABEL (priv->label_updates_spinner), spinner_str);
+ break;
case GS_SHELL_UPDATES_STATE_ACTION_REFRESH_NO_UPDATES:
spinner_str = g_strdup_printf ("%s\n%s",
gs_shell_updates_get_state_string (priv->last_status),
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 962bf71..2a006f4 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -481,6 +481,8 @@ gs_plugin_refine_item (GsPlugin *plugin,
case AS_APP_SOURCE_KIND_APPDATA:
case AS_APP_SOURCE_KIND_DESKTOP:
gs_app_set_kind (app, GS_APP_KIND_NORMAL);
+ gs_app_set_state (app, AS_APP_STATE_INSTALLED);
+ break;
case AS_APP_SOURCE_KIND_METAINFO:
gs_app_set_state (app, AS_APP_STATE_INSTALLED);
break;
diff --git a/src/plugins/gs-plugin-moduleset.c b/src/plugins/gs-plugin-moduleset.c
index 09578ce..ba2a8c5 100644
--- a/src/plugins/gs-plugin-moduleset.c
+++ b/src/plugins/gs-plugin-moduleset.c
@@ -89,9 +89,6 @@ gs_plugin_startup (GsPlugin *plugin, GError **error)
ret = gs_moduleset_parse_path (plugin->priv->moduleset,
GS_MODULESETDIR,
error);
- if (!ret)
- goto out;
-out:
gs_profile_stop (plugin->profile, "moduleset::startup");
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]