OSDN Git Service

Fixed file descriptor leak in FwdLockEngine::onGetOriginalMimeType.
authorRobert Shih <robertshih@google.com>
Fri, 8 Nov 2013 22:37:33 +0000 (14:37 -0800)
committerRobert Shih <robertshih@google.com>
Fri, 8 Nov 2013 22:37:33 +0000 (14:37 -0800)
Bug: 11534051
Change-Id: I0ab56b0a96b30f721bcac1d1ccc6ca85c3271ef5

drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp

index 234aef2..f400732 100644 (file)
@@ -316,6 +316,7 @@ String8 FwdLockEngine::onGetOriginalMimeType(int uniqueId, const String8& path,
 
     if (-1 < fileDesc) {
         if (FwdLockFile_attach(fileDesc) < 0) {
+            close(fileDesc);
             return mimeString;
         }
         const char* pMimeType = FwdLockFile_GetContentType(fileDesc);