Commit 05d8170
libbpf: Fix memory leak when emitting final btf_ext
Free temporary allocated memory used to construct finalized .BTF.ext data.
Found by Coverity static analysis on libbpf's Github repo.
Fixes: 8fd27bf ("libbpf: Add BPF static linker BTF and BTF.ext support")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20210327042502.969745-1-andrii@kernel.org1 parent b83fd19 commit 05d8170
1 file changed
+16
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1906 | 1906 | | |
1907 | 1907 | | |
1908 | 1908 | | |
1909 | | - | |
1910 | | - | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
1911 | 1913 | | |
1912 | 1914 | | |
1913 | 1915 | | |
| |||
1921 | 1923 | | |
1922 | 1924 | | |
1923 | 1925 | | |
1924 | | - | |
1925 | | - | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
1926 | 1930 | | |
1927 | 1931 | | |
1928 | 1932 | | |
| |||
1936 | 1940 | | |
1937 | 1941 | | |
1938 | 1942 | | |
1939 | | - | |
1940 | | - | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
1941 | 1947 | | |
1942 | 1948 | | |
1943 | 1949 | | |
| |||
1948 | 1954 | | |
1949 | 1955 | | |
1950 | 1956 | | |
1951 | | - | |
| 1957 | + | |
1952 | 1958 | | |
1953 | 1959 | | |
1954 | | - | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
1955 | 1963 | | |
0 commit comments