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

Commit 102b3e3f authored by Chong Zhang's avatar Chong Zhang
Browse files

Fix use-after-free in ResourceManagerService::removeResource

bug: 171814518
test: ResourceManagerService unit tests; code inspection shows
      use-after-free and should be fixed by change.
Change-Id: I43c4a75b35d274cc1c568f60f13f65f4d4470ddd
parent a5db26d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -511,8 +511,8 @@ Status ResourceManagerService::removeResource(
                resource.value -= res.value;
            } else {
                onLastRemoved(res, info);
                info.resources.erase(resType);
                actualRemoved.value = resource.value;
                info.resources.erase(resType);
            }

            // Add it to the list of removed resources for observers.