winpr-file: fixed memory leak in error case

This commit is contained in:
Bernhard Miklautz 2013-10-15 13:22:34 +02:00
parent d2790d92c8
commit 96e267fcdf

View File

@ -227,6 +227,9 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
if (status != 0) if (status != 0)
{ {
close(pNamedPipe->clientfd); close(pNamedPipe->clientfd);
free((char *)pNamedPipe->name);
free((char *)pNamedPipe->lpFileName);
free((char *)pNamedPipe->lpFilePath);
free(pNamedPipe); free(pNamedPipe);
return INVALID_HANDLE_VALUE; return INVALID_HANDLE_VALUE;
} }