[gnome-software/gnome-42: 1/2] gs-common: Fix a small leak
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-42: 1/2] gs-common: Fix a small leak
- Date: Mon, 16 May 2022 06:12:38 +0000 (UTC)
commit 84d83c692200e9f42d8fcce41c567bfe6e0bc7df
Author: Philip Withnall <pwithnall endlessos org>
Date: Thu May 12 13:35:57 2022 +0100
gs-common: Fix a small leak
`gs_app_get_origin_ui()` returns a newly allocated string.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
src/gs-common.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-common.c b/src/gs-common.c
index af56c4428..2c4fc7789 100644
--- a/src/gs-common.c
+++ b/src/gs-common.c
@@ -232,6 +232,7 @@ gs_app_notify_unavailable (GsApp *app, GtkWindow *parent)
GtkWidget *dialog;
const gchar *license;
gboolean already_enabled = FALSE; /* FIXME */
+ g_autofree gchar *origin_ui = NULL;
guint i;
struct {
const gchar *str;
@@ -286,6 +287,8 @@ gs_app_notify_unavailable (GsApp *app, GtkWindow *parent)
gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), title->str);
body = g_string_new ("");
+ origin_ui = gs_app_get_origin_ui (app);
+
if (hint & GS_APP_LICENSE_NONFREE) {
g_string_append_printf (body,
/* TRANSLATORS: the replacements are as follows:
@@ -296,7 +299,7 @@ gs_app_notify_unavailable (GsApp *app, GtkWindow *parent)
"free and open source software</a>, "
"and is provided by ā%sā."),
gs_app_get_name (app),
- gs_app_get_origin_ui (app));
+ origin_ui);
} else {
g_string_append_printf (body,
/* TRANSLATORS: the replacements are as follows:
@@ -304,7 +307,7 @@ gs_app_notify_unavailable (GsApp *app, GtkWindow *parent)
* 2. Software repository name, e.g. fedora-optional */
_("%s is provided by ā%sā."),
gs_app_get_name (app),
- gs_app_get_origin_ui (app));
+ origin_ui);
}
/* tell the use what needs to be done */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]