Fix string leaks

This commit is contained in:
Colin Leroy 2015-08-10 20:58:32 +02:00
parent 5ef1df1e1b
commit 229e17d5b7
2 changed files with 8 additions and 4 deletions

View file

@ -544,8 +544,10 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *fr
if (result && result->signatures) {
gpgme_new_signature_t sig = result->signatures;
if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
micalg = g_strdup_printf("pgp-%s", g_ascii_strdown(gpgme_hash_algo_name(
result->signatures->hash_algo),-1));
gchar *down_algo = g_ascii_strdown(gpgme_hash_algo_name(
result->signatures->hash_algo), -1);
micalg = g_strdup_printf("pgp-%s", down_algo);
g_free(down_algo);
} else {
micalg = g_strdup(gpgme_hash_algo_name(
result->signatures->hash_algo));

View file

@ -642,8 +642,10 @@ gboolean smime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *from
result = gpgme_op_sign_result(ctx);
if (result && result->signatures) {
if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
micalg = g_strdup_printf("pgp-%s", g_ascii_strdown(gpgme_hash_algo_name(
result->signatures->hash_algo),-1));
gchar *down_algo = g_ascii_strdown(gpgme_hash_algo_name(
result->signatures->hash_algo), -1);
micalg = g_strdup_printf("pgp-%s", down_algo);
g_free(down_algo);
} else {
micalg = g_strdup(gpgme_hash_algo_name(
result->signatures->hash_algo));