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.
This commit is contained in:
fG! 2017-03-18 01:17:23 +00:00 committed by Nguyen Anh Quynh
parent 15b99f10d0
commit 1bef32fff6
1 changed files with 1 additions and 0 deletions

1
uc.c
View File

@ -856,6 +856,7 @@ static bool split_region(struct uc_struct *uc, MemoryRegion *mr, uint64_t addres
goto error;
}
free(backup);
return true;
error: