diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 926bcecc4a449fc5dd5921ae30b516d4e3b20bb9..eaacb58b9b3637d4b145c233b548720394a584d3 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -1194,9 +1194,13 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev) *ptr++ = '\0'; } - tmp = strdup(arg); - if (tmp == NULL) - return -ENOMEM; + if (arg[0] == '\0') + tmp = NULL; + else { + tmp = strdup(arg); + if (tmp == NULL) + return -ENOMEM; + } if (file_spec) pp->file = tmp;