Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 430e440e authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Fix use-after-free issue caught by ASAN." into oc-dev

am: 6e03e0e3

Change-Id: I0703e88bfc8b28268b6773b4f3da7c4c51ddd765
parents 93603cb0 6e03e0e3
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -619,11 +619,9 @@ binder::Status InstalldNativeService::fixupAppData(const std::unique_ptr<std::st
        ATRACE_BEGIN("fixup user");
        FTS* fts;
        FTSENT* p;
        char *argv[] = {
                (char*) create_data_user_ce_path(uuid_, user).c_str(),
                (char*) create_data_user_de_path(uuid_, user).c_str(),
                nullptr
        };
        auto ce_path = create_data_user_ce_path(uuid_, user);
        auto de_path = create_data_user_de_path(uuid_, user);
        char *argv[] = { (char*) ce_path.c_str(), (char*) de_path.c_str(), nullptr };
        if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
            return error("Failed to fts_open");
        }
@@ -952,11 +950,9 @@ binder::Status InstalldNativeService::freeCache(const std::unique_ptr<std::strin
        for (auto user : get_known_users(uuid_)) {
            FTS *fts;
            FTSENT *p;
            char *argv[] = {
                    (char*) create_data_user_ce_path(uuid_, user).c_str(),
                    (char*) create_data_user_de_path(uuid_, user).c_str(),
                    nullptr
            };
            auto ce_path = create_data_user_ce_path(uuid_, user);
            auto de_path = create_data_user_de_path(uuid_, user);
            char *argv[] = { (char*) ce_path.c_str(), (char*) de_path.c_str(), nullptr };
            if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
                return error("Failed to fts_open");
            }