Repository navigation
Commit 8758401
libbpf: Fix the possible memory leak on error
[ Upstream commit 18353c8 ]
If the strdup() fails then we need to call bpf_object__close(obj) to
avoid a resource leak.
Fixes: 166750b ("libbpf: Support libbpf-provided extern variables")
Signed-off-by: Shuyi Cheng <chengshuyi@linux.alibaba.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1626180159-112996-3-git-send-email-chengshuyi@linux.alibaba.com
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 6d213fb commit 8758401
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7365 | 7365 | | |
7366 | 7366 | | |
7367 | 7367 | | |
7368 | | - | |
7369 | | - | |
| 7368 | + | |
| 7369 | + | |
| 7370 | + | |
| 7371 | + | |
7370 | 7372 | | |
7371 | 7373 | | |
7372 | 7374 | | |
| |||
0 commit comments