Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
struct: fix memory leak in buffer.pull()
Do not increase the refcount when returning the pulled buffer contents as string since the returned value already is the sole reference. Without this change, pulled buffer contents will be leaked whenever the `pull()` function is used. Also ensure that the buffer memory is completely zero initialized when it is allocated from scratch, the existing logic only cleared the trailing data area on reallocations but never the head on fresh allocations. Signed-off-by: Jo-Philipp Wich <[email protected]>
- Loading branch information