]> Git Repo - linux.git/blobdiff - tools/perf/util/trace-event-info.c
perf tools: Use zfree to help detect use after free bugs
[linux.git] / tools / perf / util / trace-event-info.c
index f3c9e551bd353f39cd68bf52ec4c1c4ea6892a2f..7e6fcfe8b43853da45767687f4eb9d6e1453f6c1 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "../perf.h"
 #include "trace-event.h"
-#include <lk/debugfs.h>
+#include <api/fs/debugfs.h>
 #include "evsel.h"
 
 #define VERSION "0.5"
@@ -397,8 +397,8 @@ put_tracepoints_path(struct tracepoint_path *tps)
                struct tracepoint_path *t = tps;
 
                tps = tps->next;
-               free(t->name);
-               free(t->system);
+               zfree(&t->name);
+               zfree(&t->system);
                free(t);
        }
 }
@@ -562,10 +562,8 @@ out:
                output_fd = fd;
        }
 
-       if (err) {
-               free(tdata);
-               tdata = NULL;
-       }
+       if (err)
+               zfree(&tdata);
 
        put_tracepoints_path(tps);
        return tdata;
This page took 0.028697 seconds and 4 git commands to generate.