diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 848912401c4f..c70b151428f7 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -3627,7 +3628,7 @@ static int pyrf_data__init(struct pyrf_data *pdata, PyObject *args, PyObject *kw if (pdata->data.open) perf_data__close(&pdata->data); free((char *)pdata->data.path); - pdata->data.path = NULL; + memset(&pdata->data, 0, sizeof(pdata->data)); if (fd != -1) { struct stat st;