diff options
author | Thomas Haller <thaller@redhat.com> | 2021-05-06 21:39:30 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-05-11 13:56:50 +0200 |
commit | 61029d406452305ee6a7414dbd264fbc6f535a4b (patch) | |
tree | b15c889e6c7c9220a88bcc729806b0ab90594075 | |
parent | 853f411567fef300b184f1745bee19f38be5cdfa (diff) | |
download | NetworkManager-61029d406452305ee6a7414dbd264fbc6f535a4b.tar.gz |
libnmt-newt: use cleanup macro in nmt_newt_button_build_component()
-rw-r--r-- | src/libnmt-newt/nmt-newt-button.c | 7 |
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); } |