[Commits] [SCM] claws branch, master, updated. 3.14.1-159-g3a84a64

wwp at claws-mail.org wwp at claws-mail.org
Sat Jan 21 23:55:07 CET 2017


The branch, master has been updated
       via  3a84a64d03bb909fcbc084177c41befcc3d3dbf7 (commit)
      from  20ad778b08831f0779847afe64fe881da177985d (commit)

Summary of changes:
 src/codeconv.c                              |    1 -
 src/messageview.c                           |    5 +----
 src/plugins/libravatar/libravatar_missing.c |   10 ----------
 src/procheader.c                            |   13 ++-----------
 4 files changed, 3 insertions(+), 26 deletions(-)


- Log -----------------------------------------------------------------
commit 3a84a64d03bb909fcbc084177c41befcc3d3dbf7
Author: wwp <wwp at free.fr>
Date:   Sat Jan 21 23:51:31 2017 +0100

    No need to test what g_malloc returns, as if it fails, it stops the
    program.

diff --git a/src/codeconv.c b/src/codeconv.c
index 32ef4c2..0d2438b 100644
--- a/src/codeconv.c
+++ b/src/codeconv.c
@@ -784,7 +784,6 @@ gchar *conv_codeset_strdup(const gchar *inbuf,
 	if (conv_func != conv_noconv) {
 		len = (strlen(inbuf) + 1) * 3;
 		buf = g_malloc(len);
-		if (!buf) return NULL;
 
 		if (conv_func(buf, len, inbuf) == 0 || !strict_mode)
 			return g_realloc(buf, strlen(buf) + 1);
diff --git a/src/messageview.c b/src/messageview.c
index 8ff089e..aaca56d 100644
--- a/src/messageview.c
+++ b/src/messageview.c
@@ -793,10 +793,7 @@ static void notification_convert_header(gchar **dest,
 		return;
 	} else {
 		*dest = g_malloc(BUFFSIZE);
-		if (*dest)
-			conv_encode_header(*dest, BUFFSIZE, src, header_len, FALSE);
-		else
-			debug_print("notification_convert_header: alloc");
+		conv_encode_header(*dest, BUFFSIZE, src, header_len, FALSE);
 	}
 }
 
diff --git a/src/plugins/libravatar/libravatar_missing.c b/src/plugins/libravatar/libravatar_missing.c
index 47eb188..d451510 100644
--- a/src/plugins/libravatar/libravatar_missing.c
+++ b/src/plugins/libravatar/libravatar_missing.c
@@ -57,12 +57,6 @@ GHashTable *missing_load_from_file(const gchar *filename)
 	while ((r = fscanf(file, "%s %llu\n", md5sum, &seen)) != EOF) {
 		if (t - (time_t)seen <= LIBRAVATAR_MISSING_TIME) {
 			time_t *value = g_malloc0(sizeof(time_t));
-			if (value == NULL) {
-				g_warning("cannot allocate memory");
-				g_hash_table_destroy(table);
-				table = NULL;
-				goto close_exit;
-			}
 			*value = (time_t)seen;
 			g_hash_table_insert(table, g_strdup(md5sum), value);
 		} else
@@ -141,10 +135,6 @@ void missing_add_md5(GHashTable *table, const gchar *md5)
 	time_t *seen = g_hash_table_lookup(table, md5);
 	if (seen == NULL) {
 		seen = g_malloc0(sizeof(time_t));
-		if (seen == NULL) {
-			g_warning("cannot allocate memory");
-			return;
-		}
 		*seen = t;
 		g_hash_table_insert(table, g_strdup(md5), seen);
 		debug_print("New md5 %s added with time %llu\n", md5, (long long unsigned)t);
diff --git a/src/procheader.c b/src/procheader.c
index ae54f6e..88d26db 100644
--- a/src/procheader.c
+++ b/src/procheader.c
@@ -139,11 +139,7 @@ static gint generic_get_one_field(gchar **bufptr, void *data,
 
 	len = BUFFSIZE;
 	buf = g_malloc(len);
-	if (buf == NULL) {
-		debug_print("generic_get_one_field: primary allocation error\n");
-		*bufptr = NULL;
-		return -1;
-	}
+
 	if (hentry != NULL) {
 		/* skip non-required headers */
 		/* and get hentry header line */
@@ -213,12 +209,7 @@ static gint generic_get_one_field(gchar **bufptr, void *data,
 			
 			/* read next line */
 			tmpbuf = g_malloc(BUFFSIZE);
-			if (tmpbuf == NULL) {
-				debug_print("generic_get_one_field: secondary allocation error\n");
-				g_free(buf);
-				*bufptr = NULL;
-				return -1;
-			}
+
 			if (getline(tmpbuf, BUFFSIZE, data) == NULL) {
 				g_free(tmpbuf);
 				break;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list