1. TortoiseHg
  2. TortoiseHg
  3. thg

Commits

Adrian Buehlmann  committed 8870759

shellext: check return value of CreateFileA call

  • Participants
  • Parent commits baef140
  • Branches default

Comments (0)

Files changed (1)

File win32/shellext/ContextMenu.cpp

View file
  • Ignore whitespace
             FILE_SHARE_READ, &sa, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0
         );
 
+        if (tempfileHandle == INVALID_HANDLE_VALUE)
+        {
+            TDEBUG_TRACE("DoHgtk: error: failed to create file " << tempfile);
+            return;
+        }
+
         typedef std::vector<std::string>::size_type ST;
         for (ST i = 0; i < myFiles.size(); i++)
         {