Fixed memory sanitizer warnings
This commit is contained in:
parent
004a0984b9
commit
339cdded45
@ -834,14 +834,13 @@ void xf_unlock_x11_(xfContext* xfc, const char* fkt)
|
||||
static BOOL xf_get_pixmap_info(xfContext* xfc)
|
||||
{
|
||||
int i;
|
||||
int vi_count;
|
||||
int pf_count;
|
||||
XVisualInfo* vi;
|
||||
XVisualInfo* vis;
|
||||
XVisualInfo tpl;
|
||||
XPixmapFormatValues* pf;
|
||||
XPixmapFormatValues* pfs;
|
||||
XWindowAttributes window_attributes;
|
||||
int vi_count = 0;
|
||||
int pf_count = 0;
|
||||
XVisualInfo* vi = NULL;
|
||||
XVisualInfo* vis = NULL;
|
||||
XVisualInfo tpl = { 0 };
|
||||
XPixmapFormatValues* pfs = NULL;
|
||||
XWindowAttributes window_attributes = { 0 };
|
||||
WINPR_ASSERT(xfc->display);
|
||||
pfs = XListPixmapFormats(xfc->display, &pf_count);
|
||||
|
||||
@ -853,7 +852,7 @@ static BOOL xf_get_pixmap_info(xfContext* xfc)
|
||||
|
||||
for (i = 0; i < pf_count; i++)
|
||||
{
|
||||
pf = pfs + i;
|
||||
const XPixmapFormatValues* pf = &pfs[i];
|
||||
|
||||
if (pf->depth == xfc->depth)
|
||||
{
|
||||
@ -863,7 +862,7 @@ static BOOL xf_get_pixmap_info(xfContext* xfc)
|
||||
}
|
||||
|
||||
XFree(pfs);
|
||||
ZeroMemory(&tpl, sizeof(tpl));
|
||||
|
||||
tpl.class = TrueColor;
|
||||
tpl.screen = xfc->screen_number;
|
||||
|
||||
@ -1953,7 +1952,8 @@ static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context)
|
||||
if ((status == Success) && (actual_type == XA_ATOM) && (actual_format == 32))
|
||||
{
|
||||
xfc->supportedAtomCount = nitems;
|
||||
xfc->supportedAtoms = calloc(nitems, sizeof(Atom));
|
||||
xfc->supportedAtoms = calloc(xfc->supportedAtomCount, sizeof(Atom));
|
||||
WINPR_ASSERT(xfc->supportedAtoms);
|
||||
memcpy(xfc->supportedAtoms, data, nitems * sizeof(Atom));
|
||||
}
|
||||
|
||||
|
@ -136,14 +136,14 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight)
|
||||
int nmonitors = 0;
|
||||
int monitor_index = 0;
|
||||
BOOL primaryMonitorFound = FALSE;
|
||||
VIRTUAL_SCREEN* vscreen;
|
||||
rdpSettings* settings;
|
||||
int mouse_x, mouse_y, _dummy_i;
|
||||
Window _dummy_w;
|
||||
VIRTUAL_SCREEN* vscreen = NULL;
|
||||
rdpSettings* settings = NULL;
|
||||
int mouse_x = 0, mouse_y = 0, _dummy_i = 0;
|
||||
Window _dummy_w = 0;
|
||||
int current_monitor = 0;
|
||||
Screen* screen;
|
||||
Screen* screen = NULL;
|
||||
#if defined WITH_XINERAMA || defined WITH_XRANDR
|
||||
int major, minor;
|
||||
int major = 0, minor = 0;
|
||||
#endif
|
||||
#if defined(USABLE_XRANDR)
|
||||
XRRMonitorInfo* rrmonitors = NULL;
|
||||
|
@ -345,9 +345,9 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen)
|
||||
BOOL xf_GetWindowProperty(xfContext* xfc, Window window, Atom property, int length,
|
||||
unsigned long* nitems, unsigned long* bytes, BYTE** prop)
|
||||
{
|
||||
int status;
|
||||
Atom actual_type;
|
||||
int actual_format;
|
||||
int status = 0;
|
||||
Atom actual_type = None;
|
||||
int actual_format = 0;
|
||||
|
||||
if (property == None)
|
||||
return FALSE;
|
||||
|
@ -248,7 +248,7 @@ static void settings_load_hkey_local_machine(rdpSettings* settings)
|
||||
|
||||
static BOOL settings_get_computer_name(rdpSettings* settings)
|
||||
{
|
||||
CHAR computerName[256];
|
||||
CHAR computerName[256] = { 0 };
|
||||
DWORD nSize = sizeof(computerName);
|
||||
|
||||
if (!GetComputerNameExA(ComputerNameNetBIOS, computerName, &nSize))
|
||||
|
@ -383,12 +383,12 @@ static char* comma_substring(char* s, int n)
|
||||
|
||||
int detect_keyboard_layout_from_xkbfile(void* display, DWORD* keyboardLayoutId)
|
||||
{
|
||||
char* layout;
|
||||
char* variant;
|
||||
char* layout = NULL;
|
||||
char* variant = NULL;
|
||||
DWORD group = 0;
|
||||
XkbStateRec state;
|
||||
XkbStateRec state = { 0 };
|
||||
XKeyboardState coreKbdState;
|
||||
XkbRF_VarDefsRec rules_names;
|
||||
XkbRF_VarDefsRec rules_names = { 0 };
|
||||
|
||||
DEBUG_KBD("display: %p", display);
|
||||
|
||||
|
@ -375,7 +375,7 @@ BOOL WLog_PrintMessageVA(wLog* log, DWORD type, DWORD level, size_t line, const
|
||||
}
|
||||
else
|
||||
{
|
||||
char formattedLogMessage[WLOG_MAX_STRING_SIZE];
|
||||
char formattedLogMessage[WLOG_MAX_STRING_SIZE] = { 0 };
|
||||
|
||||
if (wvsnprintfx(formattedLogMessage, WLOG_MAX_STRING_SIZE - 1, message.FormatString,
|
||||
args) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user