From 22399ba3597bde865abe26d94cd6693ce828600f Mon Sep 17 00:00:00 2001 From: Jeong Han Lee <jeonghan.lee@gmail.com> Date: Tue, 18 Sep 2018 22:45:23 +0200 Subject: [PATCH] Revert "potential memory corruption in iocshlocation" This reverts commit 144766057c07daf7719b2fcee4c45afa3c829af5. --- require.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/require.c b/require.c index 37a2ef3e..60aa5188 100644 --- a/require.c +++ b/require.c @@ -666,7 +666,7 @@ void registerModule(const char* module, const char* version, const char* locatio return; } - iocshlocation = (char*) malloc( strlen(abslocation) + strlen(iocshpath) + ll + addSlash ); + iocshlocation = malloc( strlen(abslocation) + strlen(iocshpath) ); if (iocshlocation == NULL) { fprintf(stderr, "require: registerModule: cannot allocate memory on iocshlocation \n"); @@ -693,7 +693,7 @@ void registerModule(const char* module, const char* version, const char* locatio if (location) { putenvprintf("%s_DIR=%s", module, m->content+lm+lv); - /* pathAdd("SCRIPT_PATH", m->content+lm+lv);*/ + pathAdd("SCRIPT_PATH", m->content+lm+lv); pathAdd("SCRIPT_PATH", iocshlocation); } -- GitLab