mirror of https://github.com/FreeRDP/FreeRDP
Merge pull request #2261 from akallabeth/more_memleak_fixes
More warning and memleak fixes
This commit is contained in:
commit
b579ad3cec
|
@ -523,7 +523,9 @@ int cliprdr_client_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIS
|
|||
if (formatNameSize > 15)
|
||||
formatNameSize = 15;
|
||||
|
||||
if (wszFormatName)
|
||||
Stream_Write(s, wszFormatName, formatNameSize * 2);
|
||||
|
||||
Stream_Zero(s, 32 - (formatNameSize * 2));
|
||||
|
||||
free(wszFormatName);
|
||||
|
|
|
@ -57,6 +57,9 @@ int rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, RDPGFX_H264_METAB
|
|||
RDPGFX_RECT16* regionRect;
|
||||
RDPGFX_H264_QUANT_QUALITY* quantQualityVal;
|
||||
|
||||
meta->regionRects = NULL;
|
||||
meta->quantQualityVals = NULL;
|
||||
|
||||
if (Stream_GetRemainingLength(s) < 4)
|
||||
return -1;
|
||||
|
||||
|
|
|
@ -963,6 +963,7 @@ static int xf_cliprdr_server_format_data_response(CliprdrClientContext* context,
|
|||
}
|
||||
|
||||
pDstData = NULL;
|
||||
DstSize = 0;
|
||||
|
||||
formatId = 0;
|
||||
altFormatId = 0;
|
||||
|
|
|
@ -996,10 +996,10 @@ BYTE* freerdp_bitmap_planar_delta_encode_plane(BYTE* inPlane, int width, int hei
|
|||
|
||||
int freerdp_bitmap_planar_delta_encode_planes(BYTE* inPlanes[4], int width, int height, BYTE* outPlanes[4])
|
||||
{
|
||||
freerdp_bitmap_planar_delta_encode_plane(inPlanes[0], width, height, outPlanes[0]);
|
||||
freerdp_bitmap_planar_delta_encode_plane(inPlanes[1], width, height, outPlanes[1]);
|
||||
freerdp_bitmap_planar_delta_encode_plane(inPlanes[2], width, height, outPlanes[2]);
|
||||
freerdp_bitmap_planar_delta_encode_plane(inPlanes[3], width, height, outPlanes[3]);
|
||||
outPlanes[0] = freerdp_bitmap_planar_delta_encode_plane(inPlanes[0], width, height, outPlanes[0]);
|
||||
outPlanes[1] = freerdp_bitmap_planar_delta_encode_plane(inPlanes[1], width, height, outPlanes[1]);
|
||||
outPlanes[2] = freerdp_bitmap_planar_delta_encode_plane(inPlanes[2], width, height, outPlanes[2]);
|
||||
outPlanes[3] = freerdp_bitmap_planar_delta_encode_plane(inPlanes[3], width, height, outPlanes[3]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -93,11 +93,11 @@ int shadow_subsystem_load_entry_points(RDP_SHADOW_ENTRY_POINTS* pEntryPoints, co
|
|||
|
||||
entry = shadow_subsystem_load_static_entry(name);
|
||||
|
||||
ZeroMemory(pEntryPoints, sizeof(RDP_SHADOW_ENTRY_POINTS));
|
||||
|
||||
if (!entry)
|
||||
return -1;
|
||||
|
||||
ZeroMemory(pEntryPoints, sizeof(RDP_SHADOW_ENTRY_POINTS));
|
||||
|
||||
if (entry(pEntryPoints) < 0)
|
||||
return -1;
|
||||
|
||||
|
|
|
@ -177,7 +177,8 @@ char* FindApplicationPath(char* application)
|
|||
return filename;
|
||||
}
|
||||
|
||||
HANDLE CreateProcessHandle(pid_t pid);
|
||||
static HANDLE CreateProcessHandle(pid_t pid);
|
||||
static BOOL ProcessHandleCloseHandle(HANDLE handle);
|
||||
|
||||
BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags,
|
||||
LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes,
|
||||
|
@ -291,6 +292,7 @@ BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags,
|
|||
|
||||
if (!thread)
|
||||
{
|
||||
ProcessHandleCloseHandle(process);
|
||||
goto finish;
|
||||
}
|
||||
|
||||
|
@ -456,7 +458,7 @@ BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode)
|
|||
}
|
||||
|
||||
|
||||
static BOOL ProcessHandleCloseHandle(HANDLE handle)
|
||||
BOOL ProcessHandleCloseHandle(HANDLE handle)
|
||||
{
|
||||
WINPR_PROCESS* process = (WINPR_PROCESS*) handle;
|
||||
free(process);
|
||||
|
|
|
@ -109,7 +109,7 @@ int WLog_CallbackAppender_WriteImageMessage(wLog* log, wLogCallbackAppender* app
|
|||
|
||||
int WLog_CallbackAppender_WritePacketMessage(wLog* log, wLogCallbackAppender* appender, wLogMessage* message)
|
||||
{
|
||||
if (!appender->package)
|
||||
if (appender->package)
|
||||
{
|
||||
appender->package(message);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue