From 9b8833fc3f4f1bf41615a5404010a281bb590649 Mon Sep 17 00:00:00 2001 From: Andreas Gocht Date: Fri, 26 Jan 2018 15:00:29 +0100 Subject: [PATCH] I love C ... :hankey: --- uncore_perf_plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uncore_perf_plugin.c b/uncore_perf_plugin.c index 0a2d76a..9a4d044 100644 --- a/uncore_perf_plugin.c +++ b/uncore_perf_plugin.c @@ -71,7 +71,7 @@ char* env(const char* name) { int name_len = strlen(name); int scorep_len = strlen("SCOREP_METRIC_"); - char* scorep_name = malloc((name_len + scorep_len) * sizeof(char)); + char* scorep_name = malloc((name_len + scorep_len + 1) * sizeof(char)); sprintf(scorep_name, "%s%s", "SCOREP_METRIC_", name); char* ret = getenv(scorep_name); if (ret == NULL)