Fix CID 1491150: resource leaks.
authorwwp <subscript@free.fr>
Tue, 28 Sep 2021 15:07:13 +0000 (17:07 +0200)
committerwwp <subscript@free.fr>
Tue, 28 Sep 2021 15:07:13 +0000 (17:07 +0200)
src/plugins/pgpcore/passphrase.c

index 9ef1ae55b81ed8de48f8192c6ac7ead1a4090d0f..cd23cc486ac5d4c2006c69fddc1d34772700f3f3 100644 (file)
@@ -257,23 +257,18 @@ create_description(const gchar *uid_hint, gint prev_bad, gint new_key)
        *(strchr(my_uid, '>')) = ')';
 
     if (new_key == 1) {
-           buf = g_strdup_printf (g_strconcat("<span weight=\"bold\" size=\"larger\">%s",
-                                       _("Please enter the passphrase for the new key:"),
-                                       "</span>\n\n%.*s\n", NULL),
-                           prev_bad ?
-                           _("Passphrases did not match.\n") : "",
+           buf = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s%s</span>\n\n%.*s\n",
+                           prev_bad ? _("Passphrases did not match.\n") : "",
+                           _("Please enter the passphrase for the new key:"),
                            linelen (my_uid), my_uid);
     } else if (new_key == 2) {
-           buf = g_strdup_printf (g_strconcat("<span weight=\"bold\" size=\"larger\">",
-                               _("Please re-enter the passphrase for the new key:"),
-                               "</span>\n\n%.*s\n", NULL),
+           buf = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>\n\n%.*s\n",
+                           _("Please re-enter the passphrase for the new key:"),
                            linelen (my_uid), my_uid);
     } else {
-           buf = g_strdup_printf (g_strconcat("<span weight=\"bold\" size=\"larger\">%s",
-                               _("Please enter the passphrase for:"),
-                               "</span>\n\n%.*s\n", NULL),
-                           prev_bad ?
-                           _("Bad passphrase.\n") : "",
+           buf = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s%s</span>\n\n%.*s\n",
+                           prev_bad ? _("Bad passphrase.\n") : "",
+                           _("Please enter the passphrase for:"),
                            linelen (my_uid), my_uid);
     }
     g_free(my_uid);