Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix double-free in
NewModuleFromBufferArgs
(#327)
In 0238ec3 the freeing of C strings was changed to use defers. This can cause a double-free, which in the best case it will produce a crash. The reason why this happens is that the memory address at `defer` time is captured for later execution. If `KConfigFilePath` is less than 3, it was being freed and set to NULL. Once the defer executes on function return, the same address we already freed will be passed again. We observed this while upgrading libbpfgo in Parca Agent (parca-dev/parca-agent#1599). Signed-off-by: Francisco Javier Honduvilla Coto <[email protected]>
- Loading branch information