mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 23:14:03 -05:00
Move part of libbase to Rust
This commit is contained in:
@@ -87,7 +87,7 @@ sepolicy *sepolicy::from_data(char *data, size_t len) {
|
||||
pf.len = len;
|
||||
pf.type = PF_USE_MEMORY;
|
||||
|
||||
auto db = static_cast<policydb_t *>(xmalloc(sizeof(policydb_t)));
|
||||
auto db = static_cast<policydb_t *>(malloc(sizeof(policydb_t)));
|
||||
if (policydb_init(db) || policydb_read(db, &pf, 0)) {
|
||||
LOGE("Fail to load policy from data\n");
|
||||
free(db);
|
||||
@@ -107,7 +107,7 @@ sepolicy *sepolicy::from_file(const char *file) {
|
||||
pf.fp = fp.get();
|
||||
pf.type = PF_USE_STDIO;
|
||||
|
||||
auto db = static_cast<policydb_t *>(xmalloc(sizeof(policydb_t)));
|
||||
auto db = static_cast<policydb_t *>(malloc(sizeof(policydb_t)));
|
||||
if (policydb_init(db) || policydb_read(db, &pf, 0)) {
|
||||
LOGE("Fail to load policy from %s\n", file);
|
||||
free(db);
|
||||
|
||||
Reference in New Issue
Block a user