commit 242269c: [Minor] Zero pointer to avoid free issues

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Jul 3 11:42:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-03 12:37:36 +0100
URL: https://github.com/rspamd/rspamd/commit/242269c12afc214da1c75954a3f5b167d2faba40 (HEAD -> master)

[Minor] Zero pointer to avoid free issues

---
 src/lua/lua_kann.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lua/lua_kann.c b/src/lua/lua_kann.c
index 609f05539..e356f5912 100644
--- a/src/lua/lua_kann.c
+++ b/src/lua/lua_kann.c
@@ -1067,8 +1067,8 @@ lua_kann_train1 (lua_State *L)
 		float **x, **y;
 
 		/* Fill vectors */
-		x = (float **)g_malloc (sizeof (float *) * n);
-		y = (float **)g_malloc (sizeof (float *) * n);
+		x = (float **)g_malloc0 (sizeof (float *) * n);
+		y = (float **)g_malloc0 (sizeof (float *) * n);
 
 		for (int s = 0; s < n; s ++) {
 			/* Inputs */


More information about the Commits mailing list