mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-07-29 21:03:50 +00:00
Fix file pointer leak on error path
This commit is contained in:
parent
5e050d7456
commit
0e86d4dbcb
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user