From: Herman Semenov GermanAizek@yandex.ru
--- dlls/mountmgr.sys/device.c | 5 +++++ dlls/msvcrt/dir.c | 4 ++++ dlls/msvcrt/time.c | 2 ++ dlls/winex11.drv/xim.c | 1 + 4 files changed, 12 insertions(+)
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 48ee8d9189a..1f89f38f7d1 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -1463,7 +1463,12 @@ NTSTATUS query_unix_drive( void *buff, SIZE_T insize, SIZE_T outsize, IO_STATUS_ LeaveCriticalSection( &device_section );
if (!volume) + { + free(device); + free(mount_point); + free(label); return STATUS_NO_SUCH_DEVICE; + }
switch (device_type) { diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c index 546e8d49a7b..f3bf58c2f59 100644 --- a/dlls/msvcrt/dir.c +++ b/dlls/msvcrt/dir.c @@ -1277,6 +1277,8 @@ wchar_t * CDECL _wfullpath(wchar_t * absPath, const wchar_t* relPath, size_t siz
if (size < 4) { + if (alloced) + free(buffer); *_errno() = ERANGE; return NULL; } @@ -1331,6 +1333,8 @@ char * CDECL _fullpath(char * absPath, const char* relPath, size_t size)
if (size < 4) { + if (alloced) + free(buffer); *_errno() = ERANGE; return NULL; } diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 7a110e53455..044eefbae05 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1740,6 +1740,7 @@ errno_t CDECL _ctime64_s(char *res, size_t len, const __time64_t *time)
t = _localtime64( time ); strcpy( res, asctime( t ) ); + free(t); return 0; }
@@ -1769,6 +1770,7 @@ errno_t CDECL _ctime32_s(char *res, size_t len, const __time32_t *time)
t = _localtime32( time ); strcpy( res, asctime( t ) ); + free(t); return 0; }
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index c6a93eb5e16..2bd8c63969a 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -99,6 +99,7 @@ static void xim_update_comp_string( UINT offset, UINT old_len, const WCHAR *text memmove( ptr + new_len, ptr + old_len, (len - offset - old_len) * sizeof(WCHAR) ); if (text) memcpy( ptr, text, new_len * sizeof(WCHAR) ); ime_comp_buf[len + diff] = 0; + free(ptr); }
void xim_set_result_string( HWND hwnd, const char *str, UINT count )