[gnome-software/wip/william/cherry-pick: 2/9] trivial: Guard against self-setting origin
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/william/cherry-pick: 2/9] trivial: Guard against self-setting origin
- Date: Fri, 20 May 2016 19:04:35 +0000 (UTC)
commit 3b7ca13d82b69895464f3298a7c05f0daa6c14ee
Author: William Hua <william hua canonical com>
Date: Thu Apr 14 01:17:04 2016 -0400
trivial: Guard against self-setting origin
src/gs-app.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index b2ee1c1..a7c7479 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -1533,8 +1533,11 @@ void
gs_app_set_origin (GsApp *app, const gchar *origin)
{
g_return_if_fail (GS_IS_APP (app));
- g_free (app->origin);
- app->origin = g_strdup (origin);
+
+ if (origin != app->origin) {
+ g_free (app->origin);
+ app->origin = g_strdup (origin);
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]