[gnome-software/wip/rancell/reviews] Use g_autofree for a string
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/rancell/reviews] Use g_autofree for a string
- Date: Wed, 2 Mar 2016 01:52:27 +0000 (UTC)
commit e594365f355fcf88292082aca1e500f0b0e5d57a
Author: Robert Ancell <robert ancell canonical com>
Date: Wed Mar 2 14:51:51 2016 +1300
Use g_autofree for a string
src/plugins/gs-plugin-ubuntu-reviews.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-ubuntu-reviews.c b/src/plugins/gs-plugin-ubuntu-reviews.c
index e7a18f9..6c36a1d 100644
--- a/src/plugins/gs-plugin-ubuntu-reviews.c
+++ b/src/plugins/gs-plugin-ubuntu-reviews.c
@@ -553,7 +553,7 @@ parse_review (JsonNode *node)
GsReview *review;
JsonObject *object;
gint64 star_rating;
- gchar *id_string;
+ g_autofree gchar *id_string = NULL;
if (!JSON_NODE_HOLDS_OBJECT (node))
return NULL;
@@ -571,7 +571,6 @@ parse_review (JsonNode *node)
gs_review_set_date (review, parse_date_time (json_object_get_string_member (object, "date_created")));
id_string = g_strdup_printf ("%ld", json_object_get_int_member (object, "id"));
gs_review_add_metadata (review, "ubuntu-id", id_string);
- g_free (id_string);
return review;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]