mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-01 19:22:07 +00:00
semodule: Don't forget to munmap() data
semanage_module_extract() mmap()'s the module raw data but it leaves on the caller to munmap() them. Reported-by: Ondrej Mosnacek <omosnace@redhat.com> Signed-off-by: Petr Lautrbach <plautrba@redhat.com> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
f37b3e94d3
commit
c28763c4c9
@ -394,6 +394,9 @@ static char *hash_module_data(const char *module_name, const int prio) {
|
||||
sha256_buf[i * 2] = 0;
|
||||
|
||||
cleanup_extract:
|
||||
if (data_len > 0) {
|
||||
munmap(data, data_len);
|
||||
}
|
||||
semanage_module_info_destroy(sh, extract_info);
|
||||
free(extract_info);
|
||||
semanage_module_key_destroy(sh, modkey);
|
||||
|
Loading…
Reference in New Issue
Block a user