Juan Lang : wintrust: Close file handle on error loading a message from it.

Alexandre Julliard julliard at winehq.org
Thu Jan 28 11:15:35 CST 2010


Module: wine
Branch: master
Commit: 4c1e554d191d7e75b3f9f12e0531e24bf231ef0b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4c1e554d191d7e75b3f9f12e0531e24bf231ef0b

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Jan 27 11:01:21 2010 -0800

wintrust: Close file handle on error loading a message from it.

---

 dlls/wintrust/softpub.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c
index bf866c3..8d017d2 100644
--- a/dlls/wintrust/softpub.c
+++ b/dlls/wintrust/softpub.c
@@ -364,6 +364,14 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data)
     err = SOFTPUB_DecodeInnerContent(data);
 
 error:
+    if (err && data->fOpenedFile && data->pWintrustData->u.pFile)
+    {
+        /* The caller won't expect the file to be open on failure, so close it.
+         */
+        CloseHandle(data->pWintrustData->u.pFile->hFile);
+        data->pWintrustData->u.pFile->hFile = INVALID_HANDLE_VALUE;
+        data->fOpenedFile = FALSE;
+    }
     return err;
 }
 




More information about the wine-cvs mailing list