From 1bef32fff600b4c7188447da36124398421e97b2 Mon Sep 17 00:00:00 2001 From: fG! Date: Sat, 18 Mar 2017 01:17:23 +0000 Subject: [PATCH] Fix huge memory leak on uc_mem_protect() (#787) A memory region is allocated inside split_region() that was only freed in error case but not on success case, leading to huge memory leak if the region size was significant. --- uc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/uc.c b/uc.c index a40ccd35..916ce497 100644 --- a/uc.c +++ b/uc.c @@ -856,6 +856,7 @@ static bool split_region(struct uc_struct *uc, MemoryRegion *mr, uint64_t addres goto error; } + free(backup); return true; error: