mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-13 16:32:07 +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;
|
pf.fp = fp;
|
||||||
if (policydb_write(impl->db, &pf)) {
|
if (policydb_write(impl->db, &pf)) {
|
||||||
LOGE("Fail to create policy image\n");
|
LOGE("Fail to create policy image\n");
|
||||||
|
fclose(fp);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|||||||
Reference in New Issue
Block a user