Please sign in to comment.
Free vasprintf() results with Ruby Enterprise Edition's system_free()…
… API if possible, and fix some potential memory leaks while we're at it. REE uses tcmalloc by default, but on OS X libc's vasprintf() allocates memory with the system's malloc() function instead of tcmalloc's. If we were to free its result with tcmalloc's free(), it will cause a crash. This commit makes use of REE system_free() function to free vasprintf() results. More info: https://github.com/FooBarWidget/rubyenterpriseedition187-330/blob/release/system_allocator.c Some functions also leak string memory if an exception is raised. This patch makes sure those strings are freed no matter what.
- Loading branch information...
Showing with 38 additions and 6 deletions.