summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-05-06 21:39:30 +0200
committerThomas Haller <thaller@redhat.com>2021-05-11 13:56:50 +0200
commit61029d406452305ee6a7414dbd264fbc6f535a4b (patch)
treeb15c889e6c7c9220a88bcc729806b0ab90594075
parent853f411567fef300b184f1745bee19f38be5cdfa (diff)
downloadNetworkManager-61029d406452305ee6a7414dbd264fbc6f535a4b.tar.gz
libnmt-newt: use cleanup macro in nmt_newt_button_build_component()
-rw-r--r--src/libnmt-newt/nmt-newt-button.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libnmt-newt/nmt-newt-button.c b/src/libnmt-newt/nmt-newt-button.c
index 4518499b86..974d05bdf4 100644
--- a/src/libnmt-newt/nmt-newt-button.c
+++ b/src/libnmt-newt/nmt-newt-button.c
@@ -108,18 +108,17 @@ nmt_newt_button_build_component(NmtNewtComponent *component, gboolean sensitive)
{
NmtNewtButtonPrivate *priv = NMT_NEWT_BUTTON_GET_PRIVATE(component);
newtComponent co;
- gs_free char * label = NULL;
- char * label_lc;
+ gs_free char * label_lc = NULL;
if (sensitive) {
label_lc = nmt_newt_locale_from_utf8(priv->label);
co = newtCompactButton(-1, -1, label_lc);
- g_free(label_lc);
} else {
+ gs_free char *label = NULL;
+
label = g_strdup_printf(" <%s>", priv->label);
label_lc = nmt_newt_locale_from_utf8(label);
co = newtLabel(-1, -1, label_lc);
- g_free(label_lc);
newtLabelSetColors(co, NMT_NEWT_COLORSET_DISABLED_BUTTON);
}