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

Commit 8ee7f631 authored by Zhizhou Yang's avatar Zhizhou Yang Committed by android-build-merger
Browse files

Merge "Fix memory leak warning in FwdLockEngine.cpp" am: 809ea9d9 am:...

Merge "Fix memory leak warning in FwdLockEngine.cpp" am: 809ea9d9 am: b5c1bcb9 am: d10d7e15 am: 1fb7851c
am: 991f53aa

Change-Id: I89b1855c0653c5c87876277d9aba79dbeb4b5905
parents a9c69e48 991f53aa
Loading
Loading
Loading
Loading
+8 −4
Original line number Original line Diff line number Diff line
@@ -502,8 +502,8 @@ status_t FwdLockEngine::onOpenDecryptSession(int /* uniqueId */,
        int retVal = FwdLockFile_CheckHeaderIntegrity(fileDesc);
        int retVal = FwdLockFile_CheckHeaderIntegrity(fileDesc);
        DecodeSession* decodeSession = new DecodeSession(fileDesc);
        DecodeSession* decodeSession = new DecodeSession(fileDesc);


        if (retVal && NULL != decodeSession) {
        if (retVal && NULL != decodeSession &&
            decodeSessionMap.addValue(decryptHandle->decryptId, decodeSession);
            decodeSessionMap.addValue(decryptHandle->decryptId, decodeSession)) {
            const char *pmime= FwdLockFile_GetContentType(fileDesc);
            const char *pmime= FwdLockFile_GetContentType(fileDesc);
            String8 contentType = String8(pmime == NULL ? "" : pmime);
            String8 contentType = String8(pmime == NULL ? "" : pmime);
            contentType.toLower();
            contentType.toLower();
@@ -513,7 +513,11 @@ status_t FwdLockEngine::onOpenDecryptSession(int /* uniqueId */,
            decryptHandle->decryptInfo = NULL;
            decryptHandle->decryptInfo = NULL;
            result = DRM_NO_ERROR;
            result = DRM_NO_ERROR;
        } else {
        } else {
            if (retVal && NULL != decodeSession) {
              LOG_VERBOSE("FwdLockEngine::onOpenDecryptSession Integrity Check failed for the fd");
              LOG_VERBOSE("FwdLockEngine::onOpenDecryptSession Integrity Check failed for the fd");
            } else {
              LOG_VERBOSE("FwdLockEngine::onOpenDecryptSession DecodeSesssion insertion failed");
            }
            FwdLockFile_detach(fileDesc);
            FwdLockFile_detach(fileDesc);
            delete decodeSession;
            delete decodeSession;
        }
        }