[gnome-software/wip/rancell/ubuntu-3-20-4: 5/50] Guard against self-setting origin
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/rancell/ubuntu-3-20-4: 5/50] Guard against self-setting origin
- Date: Sun, 18 Jun 2017 01:11:08 +0000 (UTC)
commit b991a5f1720841b62e5622671cb9c06dc01cc36b
Author: William Hua <william hua canonical com>
Date: Thu Apr 14 01:17:04 2016 -0400
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 db4d960..de95e83 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -1554,8 +1554,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]