mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-02-16 18:21:41 +01:00
Cleanup a mapped elf image.
Without this, we end up with mmap leaks. Thanks to Humberto Abdelnur for suggesting this.
This commit is contained in:
parent
7bd264e292
commit
6203f1cd0f
1 changed files with 8 additions and 2 deletions
|
@ -26,7 +26,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|||
#include "_UPT_internal.h"
|
||||
|
||||
void
|
||||
_UPT_destroy (void *ui)
|
||||
_UPT_destroy (void *ptr)
|
||||
{
|
||||
free (ui);
|
||||
struct UPT_info *ui = (struct UPT_info *) ptr;
|
||||
if (ui->ei.image)
|
||||
{
|
||||
munmap(ui->ei.image, ui->ei.size);
|
||||
}
|
||||
|
||||
free (ptr);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue