commit e00abd7: [Minor] Fix some dead ends

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Sep 17 20:42:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-09-17 21:35:30 +0100
URL: https://github.com/rspamd/rspamd/commit/e00abd7047b660372eebd9f30aa28ed8366493d6 (HEAD -> master)

[Minor] Fix some dead ends
Found by: coverity scan

---
 contrib/kann/kann.c      | 1 -
 src/libserver/protocol.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/kann/kann.c b/contrib/kann/kann.c
index 72fb0c061..70d1f02d6 100644
--- a/contrib/kann/kann.c
+++ b/contrib/kann/kann.c
@@ -498,7 +498,6 @@ kann_t *kann_load_fp(FILE *fp)
 
 	(void) !fread(magic, 1, 4, fp);
 	if (strncmp(magic, KANN_MAGIC, 4) != 0) {
-		fclose(fp);
 		return 0;
 	}
 	ann = (kann_t*)calloc(1, sizeof(kann_t));
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index 6e97068a6..654f16113 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -1093,6 +1093,7 @@ rspamd_protocol_rewrite_subject (struct rspamd_task *task)
 				g_string_append_c (subj_buf, '%');
 				c = p + 2;
 				p += 2;
+				break;
 			default:
 				p ++; /* Just % something unknown */
 				break;


More information about the Commits mailing list