@@ -26,7 +26,7 @@ ProcessExecute::~ProcessExecute()
2626
2727bool ProcessExecute::isWindowsNT ()
2828{
29- OSVERSIONINFO osv;
29+ OSVERSIONINFO osv{} ;
3030 osv.dwOSVersionInfoSize = sizeof (osv);
3131 ::GetVersionEx (&osv);
3232 return (osv.dwPlatformId >= VER_PLATFORM_WIN32_NT);
@@ -42,18 +42,18 @@ DWORD ProcessExecute::execute(const TCHAR *commandLine, boost::python::object py
4242 throw process_start_exception (" stderr cannot be None" );
4343
4444 // Create out, err, and in pipes (ignore in, initially)
45- SECURITY_DESCRIPTOR sd;
46- SECURITY_ATTRIBUTES sa;
45+ SECURITY_DESCRIPTOR sd{} ;
46+ SECURITY_ATTRIBUTES sa{} ;
4747 process_start_exception exceptionThrown (" " );
4848
4949 bool thrown = false ;
5050
51- PipeReaderArgs stdoutReaderArgs;
52- PipeReaderArgs stderrReaderArgs;
51+ PipeReaderArgs stdoutReaderArgs{} ;
52+ PipeReaderArgs stderrReaderArgs{} ;
5353 // Only used if spooling, but we need to delete it later.
5454 TCHAR tmpFilename[MAX_PATH] = {0 };
55- HANDLE hStdOutReadPipe, hStdOutWritePipe;
56- HANDLE hStdErrReadPipe, hStdErrWritePipe;
55+ HANDLE hStdOutReadPipe = nullptr , hStdOutWritePipe = nullptr ;
56+ HANDLE hStdErrReadPipe = nullptr , hStdErrWritePipe = nullptr ;
5757
5858 Py_BEGIN_ALLOW_THREADS
5959 try
@@ -180,8 +180,8 @@ DWORD ProcessExecute::execute(const TCHAR *commandLine, boost::python::object py
180180 ::ZeroMemory ( &pi, sizeof (PROCESS_INFORMATION) );
181181
182182 size_t commandLineLength = _tcslen (commandLine) + 1 ;
183- // We use an auto_ptr here because of a potential early out due to an exception thrown.
184- std::auto_ptr <TCHAR> cmdLine (new TCHAR[commandLineLength]);
183+ // We use an unique_ptr here because of a potential early out due to an exception thrown.
184+ std::unique_ptr <TCHAR> cmdLine (new TCHAR[commandLineLength]);
185185 _tcscpy_s (cmdLine.get (), commandLineLength, commandLine);
186186 bool processStartSuccess;
187187
@@ -283,7 +283,7 @@ DWORD WINAPI ProcessExecute::pipeReader(void *args)
283283
284284 DWORD bytesRead;
285285
286- char buffer[PIPE_READBUFSIZE];
286+ char buffer[PIPE_READBUFSIZE]{} ;
287287 BOOL processFinished = FALSE ;
288288
289289 for (;;)
0 commit comments