1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-28 12:11:45 +02: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:
Arun Sharma 2010-03-26 15:54:14 -07:00
parent 7bd264e292
commit 6203f1cd0f

View file

@ -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);
}