From 53468efa4a3a80ad53a3a9a16d2c3c14c6f355f3 Mon Sep 17 00:00:00 2001 From: Derek Bruening Date: Fri, 7 Oct 2016 15:08:32 -0400 Subject: [PATCH] i#1729 offline traces: fix use-after-free in drmodtrack Fixes an error in drmodtrack: unmapping after freeing. Review-URL: https://codereview.appspot.com/308650043 --- ext/drcovlib/modules.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/drcovlib/modules.c b/ext/drcovlib/modules.c index bae12eedc9d..3d94be948f8 100644 --- a/ext/drcovlib/modules.c +++ b/ext/drcovlib/modules.c @@ -482,8 +482,8 @@ drmodtrack_offline_exit(void *handle) if (info == NULL) return DRCOVLIB_ERROR_INVALID_PARAMETER; dr_global_free(info->mod, info->num_mods * sizeof(*info->mod)); - dr_global_free(info, sizeof(*info)); if (info->map != NULL) dr_unmap_file((char *)info->map, info->map_size); + dr_global_free(info, sizeof(*info)); return DRCOVLIB_SUCCESS; }