diff --git a/winpr/libwinpr/file/file.c b/winpr/libwinpr/file/file.c index 36da49061..cad16230f 100644 --- a/winpr/libwinpr/file/file.c +++ b/winpr/libwinpr/file/file.c @@ -227,6 +227,9 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, if (status != 0) { close(pNamedPipe->clientfd); + free((char *)pNamedPipe->name); + free((char *)pNamedPipe->lpFileName); + free((char *)pNamedPipe->lpFilePath); free(pNamedPipe); return INVALID_HANDLE_VALUE; } diff --git a/winpr/libwinpr/handle/handle.c b/winpr/libwinpr/handle/handle.c index c9f8178a5..929ee0399 100644 --- a/winpr/libwinpr/handle/handle.c +++ b/winpr/libwinpr/handle/handle.c @@ -173,7 +173,10 @@ BOOL CloseHandle(HANDLE hObject) if (pipe->serverfd != -1) close(pipe->serverfd); - free(Object); + free((char *)pipe->lpFileName); + free((char *)pipe->lpFilePath); + free((char *)pipe->name); + free(pipe); return TRUE; } diff --git a/winpr/libwinpr/pipe/pipe.c b/winpr/libwinpr/pipe/pipe.c index 583a373e7..5e3018fea 100644 --- a/winpr/libwinpr/pipe/pipe.c +++ b/winpr/libwinpr/pipe/pipe.c @@ -285,7 +285,7 @@ BOOL WaitNamedPipeA(LPCSTR lpNamedPipeName, DWORD nTimeOut) break; } } - + free(lpFilePath); return status; }