commit dbcbc2a: [Minor] Avoid null dereference on error path

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Nov 5 20:56:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-11-05 20:50:06 +0000
URL: https://github.com/rspamd/rspamd/commit/dbcbc2a0ec825f9a586f40aa6af836efd65e4b8f (HEAD -> master)

[Minor] Avoid null dereference on error path

---
 src/libstat/stat_config.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/libstat/stat_config.c b/src/libstat/stat_config.c
index d6fdc9673..66c766836 100644
--- a/src/libstat/stat_config.c
+++ b/src/libstat/stat_config.c
@@ -278,6 +278,12 @@ rspamd_stat_init (struct rspamd_config *cfg, struct ev_loop *ev_base)
 				continue;
 			}
 		}
+		else {
+			/* This actually is not implemented so it should never happen */
+			g_free (cl);
+			cur = g_list_next (cur);
+			continue;
+		}
 
 		/* XXX:
 		 * Here we get the first classifier tokenizer config as the only one


More information about the Commits mailing list