diff --git a/src/main.c b/src/main.c index 11c220f..0838ccd 100644 --- a/src/main.c +++ b/src/main.c @@ -412,11 +412,13 @@ static void set_shared_uss_env(ConfigManager *configmgr) { int length = index - thisEnv; char *key = malloc(length + 1); + memset(key, 0, sizeof(*key)); strncpy(key, thisEnv, length); if (!arrayListContains(list, key)) { arrayListAdd(list, key); char *new_env = malloc(strlen(thisEnv)); + memset(new_env, 0, sizeof(*new_env)); strncpy(new_env, thisEnv, strlen(thisEnv)); DEBUG("shared env pos %d is %s\n", idx, new_env); shared_uss_env[idx++] = new_env;