diff --git a/tools/perf/tests/dlfilter-test.c b/tools/perf/tests/dlfilter-test.c index 7eba7955d53154e1806f0dfea0a9a75dc5f6d648..bc03b5df6828d6fa2a0201b54734b325dfce41b0 100644 --- a/tools/perf/tests/dlfilter-test.c +++ b/tools/perf/tests/dlfilter-test.c @@ -239,15 +239,20 @@ static int get_dlfilters_path(char *buf, size_t sz) static int check_filter_desc(struct test_data *td) { - char *long_desc; - char *desc; + char *long_desc = NULL; + char *desc = NULL; + int ret; if (get_filter_desc(td->dlfilters, "dlfilter-test-api-v0.so", &desc, &long_desc) && long_desc && !strcmp(long_desc, "Filter used by the 'dlfilter C API' perf test") && desc && !strcmp(desc, "dlfilter to test v0 C API")) - return 0; + ret = 0; + else + ret = -1; - return -1; + free(desc); + free(long_desc); + return ret; } static int get_ip_addr(struct test_data *td)