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

Commit bc268b90 authored by Sungmin Choi's avatar Sungmin Choi
Browse files

fix potential memory leak

use delete before return

Change-Id: I5449ad90bb6910f057bd825b722c9803a7343c34
parent 73e243c4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5037,11 +5037,14 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg,
        } else {
            group = mPackageGroups.itemAt(idx-1);
            if (group == NULL) {
                delete package;
                return (mError=UNKNOWN_ERROR);
            }
        }
        err = group->packages.add(package);
        if (err < NO_ERROR) {
            delete group;
            delete package;
            return (mError=err);
        }
    } else {