[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-168-g9d73c50d6
wwp at claws-mail.org
wwp at claws-mail.org
Sun Sep 12 14:18:56 CEST 2021
The branch, gtk3 has been updated
via 9d73c50d6dcfb578bf8d65d066c867dea85a7a85 (commit)
from 9a7649aac85f5bf38f92236e5609de0c547a18e7 (commit)
Summary of changes:
src/action.c | 19 ++++++++++++-------
src/inc.c | 9 ++++++---
src/plugins/pgpcore/select-keys.c | 16 ++++++++++------
3 files changed, 28 insertions(+), 16 deletions(-)
- Log -----------------------------------------------------------------
commit 9d73c50d6dcfb578bf8d65d066c867dea85a7a85
Author: wwp <subscript at free.fr>
Date: Sun Sep 12 14:16:03 2021 +0200
Fix CID 1491213, 1491253, 1491103 and 1491189: resource leaks (if
g_locale_from_utf8() returns an empty string, still to free).
diff --git a/src/action.c b/src/action.c
index ba1aa555a..9feb3fb61 100644
--- a/src/action.c
+++ b/src/action.c
@@ -1522,9 +1522,12 @@ static void catch_input(gpointer data, gint source, GIOCondition cond)
0, -1);
ret_str = g_locale_from_utf8(input, strlen(input), &by_read,
&by_written, NULL);
- if (ret_str && by_written) {
- g_free(input);
- input = ret_str;
+ if (ret_str) {
+ if (by_written) {
+ g_free(input);
+ input = ret_str;
+ } else
+ g_free(ret_str);
}
len = strlen(input);
@@ -1605,10 +1608,12 @@ static void catch_output(gpointer data, gint source, GIOCondition cond)
buf[c] = 0;
ret_str = g_locale_to_utf8
(buf, c, &bytes_read, &bytes_written, NULL);
- if (ret_str && bytes_written > 0) {
- g_string_append_len
- (child_info->output, ret_str,
- bytes_written);
+ if (ret_str) {
+ if (bytes_written) {
+ g_string_append_len
+ (child_info->output, ret_str,
+ bytes_written);
+ }
g_free(ret_str);
} else
g_string_append_len(child_info->output, buf, c);
diff --git a/src/inc.c b/src/inc.c
index 125775f89..a085cc0d8 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -1486,9 +1486,12 @@ static void inc_notify_cmd(gint new_msgs, gboolean notify)
ret_str = g_locale_from_utf8(buf, strlen(buf), &by_read, &by_written,
NULL);
- if (ret_str && by_written) {
- g_free(buf);
- buf = ret_str;
+ if (ret_str) {
+ if (by_written) {
+ g_free(buf);
+ buf = ret_str;
+ } else
+ g_free(ret_str);
}
debug_print("executing new mail notification command: %s\n", buf);
execute_command_line(buf, TRUE, NULL);
diff --git a/src/plugins/pgpcore/select-keys.c b/src/plugins/pgpcore/select-keys.c
index b8526cfd5..936c84416 100644
--- a/src/plugins/pgpcore/select-keys.c
+++ b/src/plugins/pgpcore/select-keys.c
@@ -206,13 +206,15 @@ set_row (GtkListStore *store, gpgme_key_t key, gpgme_protocol_t proto)
s = ret_str;
}
name = g_strdup(s);
+ if (ret_str)
+ g_free(ret_str);
if (proto == GPGME_PROTOCOL_CMS && (!key->uids->email || !*key->uids->email)) {
- gpgme_user_id_t uid = key->uids->next;
- if (uid)
- s = uid->email;
- else
- s = key->uids->email;
+ gpgme_user_id_t uid = key->uids->next;
+ if (uid)
+ s = uid->email;
+ else
+ s = key->uids->email;
} else {
s = key->uids->email;
}
@@ -224,6 +226,8 @@ set_row (GtkListStore *store, gpgme_key_t key, gpgme_protocol_t proto)
s = ret_str;
}
address = g_strdup(s);
+ if (ret_str)
+ g_free(ret_str);
switch (key->uids->validity)
{
@@ -261,7 +265,7 @@ set_row (GtkListStore *store, gpgme_key_t key, gpgme_protocol_t proto)
g_free(name);
g_free(address);
- g_free (algo_buf);
+ g_free(algo_buf);
}
static gpgme_key_t
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list