diff --git a/tools/perf/util/module.c b/tools/perf/util/module.c index ddabe925d65..702083d342f 100644 --- a/tools/perf/util/module.c +++ b/tools/perf/util/module.c @@ -422,7 +422,7 @@ static int mod_dso__load_module_paths(struct mod_dso *self) len += strlen(uts.release); len += strlen("/modules.dep"); - path = calloc(1, len); + path = calloc(1, len + 1); if (path == NULL) goto out_failure;