]> Git Repo - linux.git/blobdiff - tools/perf/util/symbol-minimal.c
perf tools: Use zfree to help detect use after free bugs
[linux.git] / tools / perf / util / symbol-minimal.c
index 2d2dd0532b5a971e588086c0605ae0d6ed4080df..bd15f490d04fe5ea83607d761b65bcdfca09cbbe 100644 (file)
@@ -1,4 +1,5 @@
 #include "symbol.h"
+#include "util.h"
 
 #include <stdio.h>
 #include <fcntl.h>
@@ -253,6 +254,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso __maybe_unused,
        if (!ss->name)
                goto out_close;
 
+       ss->fd = fd;
        ss->type = type;
 
        return 0;
@@ -274,7 +276,7 @@ bool symsrc__has_symtab(struct symsrc *ss __maybe_unused)
 
 void symsrc__destroy(struct symsrc *ss)
 {
-       free(ss->name);
+       zfree(&ss->name);
        close(ss->fd);
 }
 
This page took 0.031958 seconds and 4 git commands to generate.