]> Pileus Git - ~andy/linux/blobdiff - tools/perf/util/probe-event.c
perf tools: Introduce zfree
[~andy/linux] / tools / perf / util / probe-event.c
index 095a98ec7444aa183d820c606639c272c66c79a8..4d3cd1a0278a1eb938d19ce470cbe52ad5574002 100644 (file)
@@ -506,15 +506,13 @@ static int get_real_path(const char *raw_path, const char *comp_dir,
                case EFAULT:
                        raw_path = strchr(++raw_path, '/');
                        if (!raw_path) {
-                               free(*new_path);
-                               *new_path = NULL;
+                               zfree(new_path);
                                return -ENOENT;
                        }
                        continue;
 
                default:
-                       free(*new_path);
-                       *new_path = NULL;
+                       zfree(new_path);
                        return -errno;
                }
        }