mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-27 12:19:13 +00:00
Fix file pointer leak on error path
This commit is contained in:
@@ -250,6 +250,7 @@ bool SePolicy::to_file(::rust::Utf8CStr file) const noexcept {
|
||||
pf.fp = fp;
|
||||
if (policydb_write(impl->db, &pf)) {
|
||||
LOGE("Fail to create policy image\n");
|
||||
fclose(fp);
|
||||
return false;
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
Reference in New Issue
Block a user