[gnome-software/wip/rancell/apt] Autofree string arrays
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/rancell/apt] Autofree string arrays
- Date: Thu, 3 Mar 2016 20:51:04 +0000 (UTC)
commit 8453c95d4b500ab16b1cfcd24ca43d3fdf524ca7
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Mar 4 09:50:52 2016 +1300
Autofree string arrays
src/plugins/gs-plugin-apt.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/gs-plugin-apt.c b/src/plugins/gs-plugin-apt.c
index c2ed693..38a2224 100644
--- a/src/plugins/gs-plugin-apt.c
+++ b/src/plugins/gs-plugin-apt.c
@@ -381,7 +381,7 @@ get_changelog (GsPlugin *plugin, GsApp *app)
g_autofree gchar *source_prefix = NULL, *uri = NULL, *changelog_prefix = NULL;
g_autoptr(SoupMessage) msg = NULL;
guint status_code;
- gchar **lines;
+ g_auto(GStrv) lines = NULL;
int i;
GString *details;
@@ -435,7 +435,6 @@ get_changelog (GsPlugin *plugin, GsApp *app)
g_string_append_printf (details, "%s\n\n", lines[i]);
}
}
- g_strfreev (lines);
gs_app_set_update_details (app, details->str);
g_string_free (details, TRUE);
@@ -856,7 +855,7 @@ gs_plugin_filename_to_app (GsPlugin *plugin,
g_autofree gchar *output = NULL;
g_autofree gchar *description = NULL;
g_autofree gchar *path = NULL;
- gchar **tokens = NULL;
+ g_auto(GStrv) tokens = NULL;
argv[0] = argv0 = g_strdup ("dpkg-deb");
argv[1] = argv1 = g_strdup ("--showformat=${Package}\\n"
@@ -899,7 +898,5 @@ gs_plugin_filename_to_app (GsPlugin *plugin,
gs_plugin_add_app (list, app);
- g_strfreev (tokens);
-
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]