Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/drdynvc/server/drdynvc_main.c: scope_hint: In function ‘drdynvc_server_start’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/drdynvc/server/drdynvc_main.c:125:21: warning[-Wanalyzer-malloc-leak]: leak of ‘**context.priv.ChannelHandle’
#  123|   	    WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, DRDYNVC_SVC_CHANNEL_NAME);
#  124|   
#  125|-> 	if (!context->priv->ChannelHandle)
#  126|   	{
#  127|   		WLog_ERR(TAG, "WTSVirtualChannelOpen failed!");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/drive/client/drive_main.c: scope_hint: In function ‘drive_DeviceServiceEntry’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/drive/client/drive_main.c:1054:20: warning[-Wanalyzer-malloc-leak]: leak of ‘GetKnownPath(1)’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/drive/client/drive_main.c:32: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/drive/client/drive_main.c:1031:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/drive/client/drive_main.c:1034:9: note: in expansion of macro ‘WINPR_ASSERT’
# 1052|   		drive->Path = GetKnownPath(KNOWN_PATH_HOME);
# 1053|   
# 1054|-> 		if (!drive->Path)
# 1055|   		{
# 1056|   			WLog_ERR(TAG, "_strdup failed!");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/encomsp/server/encomsp_main.c: scope_hint: In function ‘encomsp_server_start’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/encomsp/server/encomsp_main.c:303:21: warning[-Wanalyzer-malloc-leak]: leak of ‘**context.priv.ChannelHandle’
#  301|   	    WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, ENCOMSP_SVC_CHANNEL_NAME);
#  302|   
#  303|-> 	if (!context->priv->ChannelHandle)
#  304|   		return CHANNEL_RC_BAD_CHANNEL;
#  305|   

Error: CPPCHECK_WARNING (CWE-664): [#def4]
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/location/client/location_main.c:346: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#  344|   
#  345|   	UINT32 res = ERROR_INTERNAL_ERROR;
#  346|-> 	va_list ap = { 0 };
#  347|   	va_start(ap, count);
#  348|   	switch (type)

Error: CPPCHECK_WARNING (CWE-664): [#def5]
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpdr/client/rdpdr_main.c:1649: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
# 1647|                                 size_t count, ...)
# 1648|   {
# 1649|-> 	va_list ap = { 0 };
# 1650|   	WINPR_ASSERT(rdpdr);
# 1651|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpemsc/server/mouse_cursor_main.c:491:13: warning[-Wanalyzer-malloc-leak]: leak of ‘mouse_cursor_server_packet_new(12, 2, &*capsConfirm.header)’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpemsc/server/mouse_cursor_main.c:545:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpemsc/server/mouse_cursor_main.c:546:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpemsc/server/mouse_cursor_main.c:546:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpemsc/server/mouse_cursor_main.c:549:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:795:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:796:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:797:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:795:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:796:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:797:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:812:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:813:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:814:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:852:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:853:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:854:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:852:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:853:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:854:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:852:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:853:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:854:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpemsc/server/mouse_cursor_main.c:511:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpemsc/server/mouse_cursor_main.c:512:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpemsc/server/mouse_cursor_main.c:512:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1041:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1042:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpemsc/server/mouse_cursor_main.c:516:24: note: in expansion of macro ‘ERROR_OUTOFMEMORY’
#  489|   
#  490|   	/* Allocate what we need plus header bytes */
#  491|-> 	s = Stream_New(NULL, size + RDPEMSC_HEADER_SIZE);
#  492|   	if (!s)
#  493|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/remdesk/server/remdesk_main.c: scope_hint: In function ‘remdesk_server_start’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/remdesk/server/remdesk_main.c:656:21: warning[-Wanalyzer-malloc-leak]: leak of ‘**context.priv.ChannelHandle’
#  654|   	    WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, REMDESK_SVC_CHANNEL_NAME);
#  655|   
#  656|-> 	if (!context->priv->ChannelHandle)
#  657|   	{
#  658|   		WLog_ERR(TAG, "WTSVirtualChannelOpen failed!");

Error: CPPCHECK_WARNING (CWE-664): [#def8]
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/urbdrc/client/libusb/libusb_udevice.c:142: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#  140|   	{
#  141|   		char buffer[8192] = { 0 };
#  142|-> 		va_list ap = { 0 };
#  143|   		va_start(ap, error);
#  144|   		(void)vsnprintf(buffer, sizeof(buffer), fmt, ap);

Error: CPPCHECK_WARNING (CWE-664): [#def9]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/SDL/SDL2/dialogs/sdl_connection_dialog.cpp:61: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#   59|   {
#   60|   	std::lock_guard lock(_mux);
#   61|-> 	va_list ap = {};
#   62|   	va_start(ap, fmt);
#   63|   	_title = print(fmt, ap);

Error: CPPCHECK_WARNING (CWE-664): [#def10]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/SDL/SDL2/dialogs/sdl_connection_dialog.cpp:71: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#   69|   bool SDLConnectionDialog::showInfo(const char* fmt, ...)
#   70|   {
#   71|-> 	va_list ap = {};
#   72|   	va_start(ap, fmt);
#   73|   	auto rc = show(MSG_INFO, fmt, ap);

Error: CPPCHECK_WARNING (CWE-664): [#def11]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/SDL/SDL2/dialogs/sdl_connection_dialog.cpp:80: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#   78|   bool SDLConnectionDialog::showWarn(const char* fmt, ...)
#   79|   {
#   80|-> 	va_list ap = {};
#   81|   	va_start(ap, fmt);
#   82|   	auto rc = show(MSG_WARN, fmt, ap);

Error: CPPCHECK_WARNING (CWE-664): [#def12]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/SDL/SDL2/dialogs/sdl_connection_dialog.cpp:89: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#   87|   bool SDLConnectionDialog::showError(const char* fmt, ...)
#   88|   {
#   89|-> 	va_list ap = {};
#   90|   	va_start(ap, fmt);
#   91|   	auto rc = show(MSG_ERROR, fmt, ap);

Error: CPPCHECK_WARNING (CWE-664): [#def13]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/SDL/SDL2/sdl_utils.cpp:155: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#  153|   	SDL_UserEvent* event = &ev.user;
#  154|   
#  155|-> 	va_list ap = {};
#  156|   	va_start(ap, type);
#  157|   	event->type = type;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/X11/xf_cliprdr.c:1349:35: warning[-Wanalyzer-malloc-leak]: leak of ‘xf_cached_data_new(pDstData,  DstSize)’
freerdp-3.9.0-build/FreeRDP-3.9.0/client/X11/xf_cliprdr.c: scope_hint: In function ‘xf_cliprdr_server_format_data_response’
freerdp-3.9.0-build/FreeRDP-3.9.0/client/X11/xf_cliprdr.c:2152:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/client/X11/xf_cliprdr.c:2153:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/client/X11/xf_cliprdr.c:2153:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/client/X11/xf_cliprdr.c:2156:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/client/X11/xf_cliprdr.c:2159:9: note: in expansion of macro ‘WINPR_ASSERT’
# 1347|   		void* vptr;
# 1348|   	} cnv;
# 1349|-> 	cnv.uptr = 0x100000000ULL + format;
# 1350|   	return cnv.vptr;
# 1351|   }

Error: CPPCHECK_WARNING (CWE-664): [#def15]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/X11/xf_utils.c:37: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#   35|   static void write_log(wLog* log, DWORD level, const char* fname, const char* fkt, size_t line, ...)
#   36|   {
#   37|-> 	va_list ap = { 0 };
#   38|   	va_start(ap, line);
#   39|   	WLog_PrintMessageVA(log, WLOG_MESSAGE_TEXT, level, line, fname, fkt, ap);

Error: CPPCHECK_WARNING (CWE-758): [#def16]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/X11/xf_window.c:152: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  150|   	for (size_t x = 0; x < 32; x++)
#  151|   	{
#  152|-> 		const UINT32 val = 1 << x;
#  153|   		if ((style & val) != 0)
#  154|   		{

Error: CPPCHECK_WARNING (CWE-664): [#def17]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/common/client.c:1130: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
# 1128|   				          ", ignoring",
# 1129|   				          count);
# 1130|-> 			va_list ap = { 0 };
# 1131|   			va_start(ap, count);
# 1132|   			const char* scope = va_arg(ap, const char*);

Error: CPPCHECK_WARNING (CWE-664): [#def18]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/common/client_cliprdr_file.c:628: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#  626|   		return;
#  627|   
#  628|-> 	va_list ap = { 0 };
#  629|   	va_start(ap, line);
#  630|   	WLog_PrintMessageVA(log, WLOG_MESSAGE_TEXT, level, line, fname, fkt, ap);

Error: CPPCHECK_WARNING (CWE-664): [#def19]
freerdp-3.9.0-build/FreeRDP-3.9.0/client/common/file.c:1428: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
# 1426|                                                         WINPR_FORMAT_ARG const char* fmt, ...)
# 1427|   {
# 1428|-> 	va_list ap = { 0 };
# 1429|   	SSIZE_T len = 0;
# 1430|   	char* buf = NULL;

Error: CPPCHECK_WARNING (CWE-664): [#def20]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/dsp_fdk_aac.c:35: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#   33|   		char buffer[1024] = { 0 };
#   34|   
#   35|-> 		va_list ap = { 0 };
#   36|   		va_start(ap, fmt);
#   37|   		vsnprintf(buffer, sizeof(buffer), fmt, ap);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def21]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c: scope_hint: In function ‘rectangle_contained_in_band’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:390:16: warning[-Wanalyzer-out-of-bounds]: buffer over-read
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:730:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:731:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:181:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:182:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:504:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:505:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:505:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:88:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:89:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:88:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:89:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:390:16: note: read of 2 bytes from after the end of ‘empty_region’
#  388|                                           const RECTANGLE_16* rect)
#  389|   {
#  390|-> 	UINT16 refY = band->top;
#  391|   
#  392|   	if ((band->top > rect->top) || (rect->bottom > band->bottom))

Error: GCC_ANALYZER_WARNING (CWE-126): [#def22]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:392:60: warning[-Wanalyzer-out-of-bounds]: buffer over-read
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:730:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:731:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:181:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:182:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:504:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:505:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:505:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:88:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:89:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:88:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:89:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:392:60: note: read of 2 bytes from after the end of ‘empty_region’
#  390|   	UINT16 refY = band->top;
#  391|   
#  392|-> 	if ((band->top > rect->top) || (rect->bottom > band->bottom))
#  393|   		return FALSE;
#  394|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def23]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:398:40: warning[-Wanalyzer-out-of-bounds]: buffer over-read
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:730:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:731:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:181:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/codec/region.c:182:9: note: in expansion of macro ‘WINPR_ASSERT’
#  396|   	 * 		that is after rect->left we're sure that the result is False.
#  397|   	 */
#  398|-> 	while ((band < endPtr) && (band->top == refY) && (band->left <= rect->left))
#  399|   	{
#  400|   		if (rect->right <= band->right)

Error: GCC_ANALYZER_WARNING (CWE-416): [#def24]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/common/settings.c: scope_hint: In function ‘freerdp_addin_argv_free’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/common/settings.c:772:17: warning[-Wanalyzer-use-after-free]: use after ‘freerdp_addin_argv_free’ of ‘args’
#  770|   		return;
#  771|   
#  772|-> 	if (args->argv)
#  773|   	{
#  774|   		for (int index = 0; index < args->argc; index++)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def25]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/common/settings.c:772:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*args.argv’
#  770|   		return;
#  771|   
#  772|-> 	if (args->argv)
#  773|   	{
#  774|   		for (int index = 0; index < args->argc; index++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/common/settings.c: scope_hint: In function ‘freerdp_addin_argv_new’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/common/settings.c:784:12: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_addin_argv_new((long unsigned int)*args.argc, *args.argv)’
#  782|   ADDIN_ARGV* freerdp_addin_argv_new(size_t argc, const char* argv[])
#  783|   {
#  784|-> 	if (argc > INT32_MAX)
#  785|   		return NULL;
#  786|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/common/settings.c:790:12: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_addin_argv_new((long unsigned int)*args.argc, *args.argv)’
#  788|   	if (!args)
#  789|   		return NULL;
#  790|-> 	if (argc == 0)
#  791|   		return args;
#  792|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/common/settings.c:793:22: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_addin_argv_new((long unsigned int)*args.argc, *args.argv)’
#  791|   		return args;
#  792|   
#  793|-> 	args->argc = (int)argc;
#  794|   	args->argv = calloc(argc, sizeof(char*));
#  795|   	if (!args->argv)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/common/settings.c:812:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
#  810|   	WINPR_PRAGMA_DIAG_PUSH
#  811|   	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
#  812|-> 	freerdp_addin_argv_free(args);
#  813|   	WINPR_PRAGMA_DIAG_POP
#  814|   	return NULL;

Error: GCC_ANALYZER_WARNING (CWE-762): [#def30]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/common/settings.c:812:9: warning[-Wanalyzer-mismatching-deallocation]: ‘args’ should have been deallocated with ‘free’ but was deallocated with ‘freerdp_addin_argv_free’
#  810|   	WINPR_PRAGMA_DIAG_PUSH
#  811|   	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
#  812|-> 	freerdp_addin_argv_free(args);
#  813|   	WINPR_PRAGMA_DIAG_POP
#  814|   	return NULL;

Error: CPPCHECK_WARNING (CWE-664): [#def31]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/aad.c:60: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#   58|   static SSIZE_T stream_sprintf(wStream* s, WINPR_FORMAT_ARG const char* fmt, ...)
#   59|   {
#   60|-> 	va_list ap = { 0 };
#   61|   	va_start(ap, fmt);
#   62|   	const int rc = vsnprintf(NULL, 0, fmt, ap);

Error: CPPCHECK_WARNING (CWE-664): [#def32]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/freerdp.c:1307: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
# 1305|   void setChannelError(rdpContext* context, UINT errorNum, WINPR_FORMAT_ARG const char* format, ...)
# 1306|   {
# 1307|-> 	va_list ap = { 0 };
# 1308|   	va_start(ap, format);
# 1309|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/arm.c: scope_hint: In function ‘arm_treat_azureInstanceNetworkMetadata’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/arm.c:732:12: warning[-Wanalyzer-malloc-leak]: leak of ‘WINPR_JSON_Parse(metadata)’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:29: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/collections.h:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/types.h:139: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/settings_types_private.h:29: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.h:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/arm.c:24: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:203:28: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/arm.c:898:9: note: in expansion of macro ‘WLog_DBG’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/arm.c:841:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/arm.c:842:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/arm.c:843:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/arm.c:843:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/arm.c:683:9: note: in expansion of macro ‘WINPR_ASSERT’
#  730|   	}
#  731|   
#  732|-> 	if (!freerdp_target_net_adresses_reset(settings, count))
#  733|   		return FALSE;
#  734|   

Error: CPPCHECK_WARNING (CWE-664): [#def34]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/http.c:348: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#  346|   	context->Pragma = NULL;
#  347|   
#  348|-> 	va_list ap = { 0 };
#  349|   	va_start(ap, Pragma);
#  350|   	return list_append(context, Pragma, ap);

Error: CPPCHECK_WARNING (CWE-664): [#def35]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/http.c:359: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#  357|   		return FALSE;
#  358|   
#  359|-> 	va_list ap = { 0 };
#  360|   	va_start(ap, Pragma);
#  361|   	return list_append(context, Pragma, ap);

Error: CPPCHECK_WARNING (CWE-664): [#def36]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/http.c:554: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#  552|   {
#  553|   	char* str = NULL;
#  554|-> 	va_list ap = { 0 };
#  555|   	int length = 0;
#  556|   	int used = 0;

Error: CPPCHECK_WARNING (CWE-664): [#def37]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/gateway/tsg.c:765: error[va_list_usedBeforeStarted]: va_list 'ap' used before va_start() was called.
#  763|   {
#  764|   	int rc = 0;
#  765|-> 	va_list ap = { 0 };
#  766|   	if (!buffer || !len || !fmt)
#  767|   		return FALSE;

Error: COMPILER_WARNING (CWE-9001): [#def38]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:68:1: warning[-Wcomment]: multi-line comment
#   68 | // #define LICENSE_PKT_CS_MASK \
#      | ^
#   66|   };
#   67|   
#   68|-> // #define LICENSE_PKT_CS_MASK \
#   69|   //	(LICENSE_INFO | NEW_LICENSE_REQUEST | PLATFORM_CHALLENGE_RESPONSE | ERROR_ALERT)
#   70|   //#define LICENSE_PKT_SC_MASK \

Error: COMPILER_WARNING (CWE-9001): [#def39]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:70:1: warning[-Wcomment]: multi-line comment
#   70 | //#define LICENSE_PKT_SC_MASK \
#      | ^
#   68|   // #define LICENSE_PKT_CS_MASK \
#   69|   //	(LICENSE_INFO | NEW_LICENSE_REQUEST | PLATFORM_CHALLENGE_RESPONSE | ERROR_ALERT)
#   70|-> //#define LICENSE_PKT_SC_MASK \
#   71|   //	(LICENSE_REQUEST | PLATFORM_CHALLENGE | NEW_LICENSE | UPGRADE_LICENSE | ERROR_ALERT)
#   72|   //#define LICENSE_PKT_MASK (LICENSE_PKT_CS_MASK | LICENSE_PKT_SC_MASK)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c: scope_hint: In function ‘license_read_binary_blob_data’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1476:28: warning[-Wanalyzer-malloc-leak]: leak of ‘*blob.data’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:2619:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1499:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:445:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/collections.h:34: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1504:9: note: in expansion of macro ‘Stream_Read_UINT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1504:9: note: in expansion of macro ‘Stream_Read_UINT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:165:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:166:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1504:9: note: in expansion of macro ‘Stream_Read_UINT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1505:9: note: in expansion of macro ‘Stream_Read_UINT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:165:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:166:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1505:9: note: in expansion of macro ‘Stream_Read_UINT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:445:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:995:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c: scope_hint: In function ‘license_read_binary_blob_data’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1448:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1449:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1449:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/license.c:1450:9: note: in expansion of macro ‘WINPR_ASSERT’
# 1474|   	blob->data = NULL;
# 1475|   	if (blob->length > 0)
# 1476|-> 		blob->data = malloc(blob->length);
# 1477|   	if (!blob->data)
# 1478|   	{

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c: scope_hint: In function ‘find_path_exists_with_dijkstra’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c:405:23: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_array(count)’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/collections.h:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/types.h:139: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/settings_types_private.h:29: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.h:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c:24: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c:427:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c:427:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c:430:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c:430:9: note: in expansion of macro ‘WINPR_ASSERT’
#  403|   {
#  404|   	// NOLINTNEXTLINE(clang-analyzer-unix.MallocSizeof)
#  405|-> 	BYTE* array = calloc(count * sizeof(uintptr_t), count * sizeof(UINT32));
#  406|   	UINT32** dst = (UINT32**)array;
#  407|   	UINT32* val = (UINT32*)(array + count * sizeof(uintptr_t));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def42]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c: scope_hint: In function ‘alloc_array’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c:409:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘array’
#  407|   	UINT32* val = (UINT32*)(array + count * sizeof(uintptr_t));
#  408|   	for (size_t x = 0; x < count; x++)
#  409|-> 		dst[x] = &val[x];
#  410|   
#  411|   	return dst;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c: scope_hint: In function ‘freerdp_settings_get_config_path.part.0’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c:738:9: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_settings_get_config_path.part.0()’
#  736|   	if (base)
#  737|   		path = GetCombinedPath(base, FREERDP_PRODUCT_STRING);
#  738|-> 	free(base);
#  739|   
#  740|   	return path;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c: scope_hint: In function ‘freerdp_settings_int_buffer_copy’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c:1265:20: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_clone(*settings.RdpServerCertificate)’
# 1263|   		if (!cert)
# 1264|   			goto out_fail;
# 1265|-> 		if (!freerdp_settings_set_pointer_len(_settings, FreeRDP_RdpServerCertificate, cert, 1))
# 1266|   			goto out_fail;
# 1267|   	}

Error: GCC_ANALYZER_WARNING (CWE-762): [#def45]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c: scope_hint: In function ‘freerdp_settings_clone’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.c:1531:9: warning[-Wanalyzer-mismatching-deallocation]: ‘_settings’ should have been deallocated with ‘free’ but was deallocated with ‘freerdp_settings_free’
# 1529|   	WINPR_PRAGMA_DIAG_PUSH
# 1530|   	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 1531|-> 	freerdp_settings_free(_settings);
# 1532|   	WINPR_PRAGMA_DIAG_POP
# 1533|   	return NULL;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def46]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/transport.c: scope_hint: In function ‘transport_layer_free’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/transport.c:1915:21: warning[-Wanalyzer-use-after-free]: use after ‘transport_layer_free’ of ‘layer’
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/api.h:79:21: note: in definition of macro ‘IFCALL’
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/api.h:79:21: note: in definition of macro ‘IFCALL’
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/api.h:79:21: note: in definition of macro ‘IFCALL’
# 1913|   		return;
# 1914|   
# 1915|-> 	IFCALL(layer->Close, layer->userContext);
# 1916|   	free(layer->userContext);
# 1917|   	free(layer);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c: scope_hint: In function ‘freerdp_certificate_get_fingerprint_by_hash’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c:1347:27: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_get_fingerprint_by_hash(cert, "sha256")’
# 1345|   	BYTE* fp = NULL;
# 1346|   	char* fp_buffer = NULL;
# 1347|-> 	if (!cert || !cert->x509)
# 1348|   	{
# 1349|   		WLog_ERR(TAG, "Invalid certificate [%p, %p]", cert, cert ? cert->x509 : NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c: scope_hint: In function ‘freerdp_certificate_get_fingerprint_by_hash_ex’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c:1347:27: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_get_fingerprint_by_hash_ex(cert,  hash, 1)’
# 1345|   	BYTE* fp = NULL;
# 1346|   	char* fp_buffer = NULL;
# 1347|-> 	if (!cert || !cert->x509)
# 1348|   	{
# 1349|   		WLog_ERR(TAG, "Invalid certificate [%p, %p]", cert, cert ? cert->x509 : NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c: scope_hint: In function ‘freerdp_certificate_get_pem_ex’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c:1451:18: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_get_pem_ex(cert,  pLength, 1)’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c:1449:9: note: in expansion of macro ‘WINPR_ASSERT’
# 1449|   	WINPR_ASSERT(cert);
# 1450|   
# 1451|-> 	if (!cert->x509)
# 1452|   		return NULL;
# 1453|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate_store.c:168:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
#  166|   	WINPR_PRAGMA_DIAG_PUSH
#  167|   	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
#  168|-> 	freerdp_certificate_store_free(store);
#  169|   	WINPR_PRAGMA_DIAG_POP
#  170|   	return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/emu/scard/smartcard_virtual_gids.c:284:14: warning[-Wanalyzer-malloc-leak]: leak of ‘vgids_ef_new(ctx, 40976)’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/emu/scard/smartcard_virtual_gids.c: scope_hint: In function ‘vgids_init’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:821:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:822:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:823:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:795:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:796:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:797:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:890:25: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:890:25: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:891:25: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:891:25: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:892:25: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/emu/scard/smartcard_virtual_gids.c: scope_hint: In function ‘vgids_init’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/emu/scard/smartcard_virtual_gids.c: scope_hint: In function ‘vgids_init’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:206:28: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/emu/scard/smartcard_virtual_gids.c:302:17: note: in expansion of macro ‘WLog_ERR’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/emu/scard/smartcard_virtual_gids.c: scope_hint: In function ‘vgids_init’
#  282|   	Stream_SetLength(ef->data, 0);
#  283|   
#  284|-> 	if (!ArrayList_Append(ctx->files, ef))
#  285|   	{
#  286|   		WLog_ERR(TAG, "Failed to add new ef to file list");

Error: COMPILER_WARNING (CWE-1164): [#def52]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/primitives/sse/prim_copy_avx2.c:37:25: warning[-Wunused-function]: ‘avx2_image_copy_no_overlap_convert’ declared ‘static’ but never defined
#   37 | static INLINE pstatus_t avx2_image_copy_no_overlap_convert(
#      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   35|   #include <immintrin.h>
#   36|   
#   37|-> static INLINE pstatus_t avx2_image_copy_no_overlap_convert(
#   38|       BYTE* WINPR_RESTRICT pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst,
#   39|       UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, DWORD SrcFormat,

Error: COMPILER_WARNING: [#def53]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/primitives/sse/prim_copy_avx2.c: scope_hint: In function ‘avx2_image_copy_bgr24_bgrx32’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/primitives/sse/prim_copy_avx2.c:55:23: warning[-Wpsabi]: AVX vector return without AVX enabled changes the ABI
#   53|   	const SSIZE_T dstByte = 4;
#   54|   
#   55|-> 	const __m256i mask = _mm256_set_epi32(0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000,
#   56|   	                                      0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000);
#   57|   	const __m256i smask = _mm256_set_epi32(0xff171615, 0xff141312, 0xff1110ff, 0xffffffff,

Error: COMPILER_WARNING (CWE-1164): [#def54]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/primitives/sse/prim_copy_sse4_1.c:37:25: warning[-Wunused-function]: ‘sse_image_copy_no_overlap_convert’ declared ‘static’ but never defined
#   37 | static INLINE pstatus_t sse_image_copy_no_overlap_convert(
#      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   35|   #include <immintrin.h>
#   36|   
#   37|-> static INLINE pstatus_t sse_image_copy_no_overlap_convert(
#   38|       BYTE* WINPR_RESTRICT pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst,
#   39|       UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, DWORD SrcFormat,

Error: GCC_ANALYZER_WARNING (CWE-416): [#def55]
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c: scope_hint: In function ‘pf_server_config_free’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:846:20: warning[-Wanalyzer-use-after-free]: use after ‘pf_server_config_free’ of ‘config’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/collections.h:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:27: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:950:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:951:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:951:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c: scope_hint: In function ‘pf_server_config_free’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c: scope_hint: In function ‘pf_server_config_free’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:927:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:928:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:928:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:929:9: note: in expansion of macro ‘WINPR_ASSERT’
#  844|   		return;
#  845|   
#  846|-> 	free(config->Passthrough);
#  847|   	free(config->Intercept);
#  848|   	free(config->RequiredPlugins);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c: scope_hint: In function ‘pf_config_clone’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:1000:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:950:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:951:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:951:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c: scope_hint: In function ‘pf_config_clone’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c: scope_hint: In function ‘pf_config_clone’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:927:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:928:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:928:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:929:9: note: in expansion of macro ‘WINPR_ASSERT’
#  998|   	WINPR_PRAGMA_DIAG_PUSH
#  999|   	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 1000|-> 	pf_server_config_free(tmp);
# 1001|   	WINPR_PRAGMA_DIAG_POP
# 1002|   	return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-762): [#def57]
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:1000:9: warning[-Wanalyzer-mismatching-deallocation]: ‘tmp’ should have been deallocated with ‘free’ but was deallocated with ‘pf_server_config_free’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:950:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:951:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:951:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c: scope_hint: In function ‘pf_config_clone’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c: scope_hint: In function ‘pf_config_clone’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:927:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:928:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:928:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_config.c:929:9: note: in expansion of macro ‘WINPR_ASSERT’
#  998|   	WINPR_PRAGMA_DIAG_PUSH
#  999|   	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 1000|-> 	pf_server_config_free(tmp);
# 1001|   	WINPR_PRAGMA_DIAG_POP
# 1002|   	return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def58]
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_server.c: scope_hint: In function ‘pf_server_stop.part.0’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_server.c:1048:15: warning[-Wanalyzer-use-after-free]: use after ‘pf_server_free’ of ‘server’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/proxy/pf_server.c:932:9: note: in expansion of macro ‘WINPR_ASSERT’
# 1046|   
# 1047|   	/* signal main thread to stop and wait for the thread to exit */
# 1048|-> 	(void)SetEvent(server->stopEvent);
# 1049|   }
# 1050|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
freerdp-3.9.0-build/FreeRDP-3.9.0/server/shadow/shadow_server.c: scope_hint: In function ‘shadow_server_init_certificate’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/shadow/shadow_server.c:867:42: warning[-Wanalyzer-malloc-leak]: leak of ‘GetCombinedPath(*server.ConfigPath, "shadow")’
freerdp-3.9.0-build/FreeRDP-3.9.0/server/shadow/shadow_server.c:26: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/server/shadow/shadow_server.c:840:9: note: in expansion of macro ‘WINPR_ASSERT’
#  865|   
#  866|   	if ((!winpr_PathFileExists(server->CertificateFile)) ||
#  867|-> 	    (!winpr_PathFileExists(server->PrivateKeyFile)))
#  868|   	{
#  869|   		if (!shadow_server_create_certificate(server, filepath))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/sspi/Kerberos/krb5glue_mit.c:31: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/sspi/Kerberos/krb5glue_mit.c: scope_hint: In function ‘krb5glue_get_init_creds’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:20: warning[-Wanalyzer-malloc-leak]: leak of ‘create_temporary_file()’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/sspi/Kerberos/krb5glue_mit.c:133:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/sspi/Kerberos/krb5glue_mit.c:133:9: note: in expansion of macro ‘WINPR_ASSERT’
#   40|   		WINPR_PRAGMA_DIAG_PUSH                                       \
#   41|   		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE \
#   42|-> 		if (!(cond))                                                 \
#   43|   			winpr_int_assert(#cond, __FILE__, __func__, __LINE__);   \
#   44|   		WINPR_PRAGMA_DIAG_POP                                        \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/collections.h:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/types.h:139: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/settings_types_private.h:29: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.h:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/tcp.c:23: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/tcp.c: scope_hint: In function ‘freerdp_tcp_connect_layer’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:20: warning[-Wanalyzer-malloc-leak]: leak of ‘transport_layer_new(freerdp_get_transport(context), 16)’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/tcp.c:1512:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/tcp.c:1487:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/tcp.c:1490:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/tcp.c:1512:9: note: in expansion of macro ‘WINPR_ASSERT’
#   40|   		WINPR_PRAGMA_DIAG_PUSH                                       \
#   41|   		WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE \
#   42|-> 		if (!(cond))                                                 \
#   43|   			winpr_int_assert(#cond, __FILE__, __func__, __LINE__);   \
#   44|   		WINPR_PRAGMA_DIAG_POP                                        \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/collections.h:34: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/types.h:139: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/settings_types_private.h:29: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/settings.h:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:24: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h: scope_hint: In function ‘update_recv_secondary_order’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:150:38: warning[-Wanalyzer-malloc-leak]: leak of ‘update_read_cache_brush_order(update,  s, (int)stream_read_u16_le(s, 1))’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/update.h:131:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c: scope_hint: In function ‘update_recv_secondary_order’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:103:9: note: in expansion of macro ‘Stream_CheckAndLogRequiredLengthOfSize’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:4296:14: note: in expansion of macro ‘Stream_CheckAndLogRequiredLength’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:4299:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:4299:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:4299:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/update.h:131:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c: scope_hint: In function ‘update_recv_secondary_order’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:3941:9: note: in expansion of macro ‘Stream_Read_INT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h: scope_hint: In function ‘update_recv_secondary_order’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:165:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:166:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:3941:9: note: in expansion of macro ‘Stream_Read_INT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c: scope_hint: In function ‘update_recv_secondary_order’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:3942:9: note: in expansion of macro ‘Stream_Read_UINT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:165:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:166:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:3942:9: note: in expansion of macro ‘Stream_Read_UINT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:3943:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:3943:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1041:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1042:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:103:9: note: in expansion of macro ‘Stream_CheckAndLogRequiredLengthOfSize’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:3968:14: note: in expansion of macro ‘Stream_CheckAndLogRequiredLength’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/update.h:131:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c: scope_hint: In function ‘update_recv_secondary_order’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:103:9: note: in expansion of macro ‘Stream_CheckAndLogRequiredLengthOfSize’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2919:14: note: in expansion of macro ‘Stream_CheckAndLogRequiredLength’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2922:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2922:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2922:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2923:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2923:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2929:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2929:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2929:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2930:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2930:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2933:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2933:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2934:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:2934:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/settings_types_private.h:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/api.h:103:11: note: in definition of macro ‘IFCALLRESULT’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/core/orders.c:4075:46: note: in expansion of macro ‘IFCALLRESULT’
#  148|   		WINPR_ASSERT(Stream_GetRemainingLength(_s) >= sizeof(UINT8));
#  149|   
#  150|-> 		const UINT8 v = *(_s)->pointer;
#  151|   		if (seek)
#  152|   			Stream_Seek(_s, sizeof(UINT8));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def63]
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c: scope_hint: In function ‘rdpgfx_recv_caps_advertise_pdu’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:647:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘capsSet’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1298:17: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:22: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1793:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1794:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1033:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1033:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c: scope_hint: In function ‘rdpgfx_recv_caps_advertise_pdu’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1041:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1042:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1024:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1041:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1042:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:103:9: note: in expansion of macro ‘Stream_CheckAndLogRequiredLengthOfSize’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1278:14: note: in expansion of macro ‘Stream_CheckAndLogRequiredLength’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1281:9: note: in expansion of macro ‘Stream_Read_UINT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1281:9: note: in expansion of macro ‘Stream_Read_UINT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:165:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:166:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1281:9: note: in expansion of macro ‘Stream_Read_UINT16’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1298:17: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1298:17: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:211:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:212:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1298:17: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/rdpgfx/server/rdpgfx_main.c:1298:17: note: in expansion of macro ‘Stream_Read_UINT32’
#  645|   	do                                     \
#  646|   	{                                      \
#  647|-> 		_v = stream_read_u32_le(_s, TRUE); \
#  648|   	} while (0)
#  649|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:30: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/include/freerdp/freerdp.h:25: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/location/server/location_main.c:22: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h: scope_hint: In function ‘location_server_packet_send’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:813:32: warning[-Wanalyzer-malloc-leak]: leak of ‘Stream_New(0, 14)’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/location/server/location_main.c:573:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/location/server/location_main.c:574:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/location/server/location_main.c:574:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:812:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:813:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:814:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:852:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:853:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:854:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:852:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:853:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:854:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:852:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:853:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:854:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/location/server/location_main.c:541:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/location/server/location_main.c:542:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/location/server/location_main.c:542:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1041:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:1042:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/synch.h:32: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/stream.h:29: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/channels/location/server/location_main.c:546:24: note: in expansion of macro ‘ERROR_OUTOFMEMORY’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:42:23: note: in definition of macro ‘WINPR_ASSERT’
#  811|   	{
#  812|   		WINPR_ASSERT(_s);
#  813|-> 		WINPR_ASSERT(_s->pointer);
#  814|   		WINPR_ASSERT(Stream_GetRemainingCapacity(_s) >= 2);
#  815|   		*_s->pointer++ = (_v)&0xFF;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:36: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:150:21: warning[-Wanalyzer-malloc-leak]: leak of ‘GetKnownPath(id)’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:205:29: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:393:17: note: in expansion of macro ‘WLog_WARN’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:152:17: note: in expansion of macro ‘WLog_Print’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:205:29: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:393:17: note: in expansion of macro ‘WLog_WARN’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:205:29: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:393:17: note: in expansion of macro ‘WLog_WARN’
#  148|   	{                                                         \
#  149|   		static wLog* _log_cached_ptr = NULL;                  \
#  150|-> 		if (!_log_cached_ptr)                                 \
#  151|   			_log_cached_ptr = WLog_Get(_tag);                 \
#  152|   		WLog_Print(_log_cached_ptr, _log_level, __VA_ARGS__); \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c: scope_hint: In function ‘freerdp_certificate_get_fingerprint_by_hash’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:150:21: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_get_fingerprint_by_hash(cert, "sha256")’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:206:28: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c:1349:17: note: in expansion of macro ‘WLog_ERR’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:206:28: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c:1349:17: note: in expansion of macro ‘WLog_ERR’
#  148|   	{                                                         \
#  149|   		static wLog* _log_cached_ptr = NULL;                  \
#  150|-> 		if (!_log_cached_ptr)                                 \
#  151|   			_log_cached_ptr = WLog_Get(_tag);                 \
#  152|   		WLog_Print(_log_cached_ptr, _log_level, __VA_ARGS__); \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/assert.h:29: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c: scope_hint: In function ‘freerdp_certificate_get_fingerprint_by_hash_ex’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:150:21: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_get_fingerprint_by_hash_ex(cert,  hash, 1)’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:206:28: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c:1349:17: note: in expansion of macro ‘WLog_ERR’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/wlog.h:206:28: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.9.0-build/FreeRDP-3.9.0/libfreerdp/crypto/certificate.c:1349:17: note: in expansion of macro ‘WLog_ERR’
#  148|   	{                                                         \
#  149|   		static wLog* _log_cached_ptr = NULL;                  \
#  150|-> 		if (!_log_cached_ptr)                                 \
#  151|   			_log_cached_ptr = WLog_Get(_tag);                 \
#  152|   		WLog_Print(_log_cached_ptr, _log_level, __VA_ARGS__); \

Error: GCC_ANALYZER_WARNING (CWE-775): [#def68]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c: scope_hint: In function ‘CommCreateFileA’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c:1360:60: warning[-Wanalyzer-fd-leak]: leak of file descriptor
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c:1081:29: note: in expansion of macro ‘_tcsnlen’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c:1088:9: note: in expansion of macro ‘_tcsncpy’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c:1088:9: note: in expansion of macro ‘_tcsncpy’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c:34: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c: scope_hint: In function ‘CommCreateFileA’
# 1358|   error_handle:
# 1359|   	WINPR_PRAGMA_DIAG_PUSH
# 1360|-> 	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC(void) CloseHandle(pComm);
# 1361|   	WINPR_PRAGMA_DIAG_POP
# 1362|   	return INVALID_HANDLE_VALUE;

Error: GCC_ANALYZER_WARNING (CWE-762): [#def69]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c:1360:60: warning[-Wanalyzer-mismatching-deallocation]: ‘pComm’ should have been deallocated with ‘free’ but was deallocated with ‘CloseHandle’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c:1081:29: note: in expansion of macro ‘_tcsnlen’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c:1088:9: note: in expansion of macro ‘_tcsncpy’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c:1088:9: note: in expansion of macro ‘_tcsncpy’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/comm/comm.c: scope_hint: In function ‘CommCreateFileA’
# 1358|   error_handle:
# 1359|   	WINPR_PRAGMA_DIAG_PUSH
# 1360|-> 	WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC(void) CloseHandle(pComm);
# 1361|   	WINPR_PRAGMA_DIAG_POP
# 1362|   	return INVALID_HANDLE_VALUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/environment/environment.c: scope_hint: In function ‘MergeEnvironmentStrings’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/environment/environment.c:329:12: warning[-Wanalyzer-malloc-leak]: leak of ‘MergeEnvironmentStrings(*envBlock,  envstr)’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/include/winpr/crt.h:31: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/environment/environment.c:24: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/environment/environment.c:568:23: note: in expansion of macro ‘sprintf_s’
#  327|   	mergeStrings = (LPCSTR*)calloc(mergeArraySize, sizeof(char*));
#  328|   
#  329|-> 	if (!mergeStrings)
#  330|   		return NULL;
#  331|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/environment/environment.c:336:16: warning[-Wanalyzer-malloc-leak]: leak of ‘MergeEnvironmentStrings(*envBlock,  envstr)’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/environment/environment.c:568:23: note: in expansion of macro ‘sprintf_s’
#  334|   	cp = merge;
#  335|   
#  336|-> 	while (*cp && *(cp + 1))
#  337|   	{
#  338|   		length = strlen(cp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/file.c: scope_hint: In function ‘winpr_fopen’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/file.c:1472:16: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_fopen(_strdup(lpFileName), "ab")’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/file.c: scope_hint: In function ‘winpr_fopen’
# 1470|   {
# 1471|   #ifndef _WIN32
# 1472|-> 	return fopen(path, mode);
# 1473|   #else
# 1474|   	LPWSTR lpPathW = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/file.c:1472:16: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_fopen(_strdup(lpFileName), FileGetMode(dwDesiredAccess,  dwCreationDisposition, & create))’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/file.c: scope_hint: In function ‘winpr_fopen’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/file.c:46: included_from: Included from here.
# 1470|   {
# 1471|   #ifndef _WIN32
# 1472|-> 	return fopen(path, mode);
# 1473|   #else
# 1474|   	LPWSTR lpPathW = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/generic.c: scope_hint: In function ‘file_search_new’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/generic.c:886:12: warning[-Wanalyzer-malloc-leak]: leak of ‘file_search_new(lpFileName,  flen - patternlen,  ptr + 1, patternlen)’
#  884|   {
#  885|   	WIN32_FILE_SEARCH* pFileSearch = (WIN32_FILE_SEARCH*)calloc(1, sizeof(WIN32_FILE_SEARCH));
#  886|-> 	if (!pFileSearch)
#  887|   		return NULL;
#  888|   	WINPR_ASSERT(sizeof(file_search_magic) == sizeof(pFileSearch->magic));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/generic.c:51: included_from: Included from here.
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/generic.c:906:45: warning[-Wanalyzer-malloc-leak]: leak of ‘file_search_new(lpFileName,  flen - patternlen,  ptr + 1, patternlen)’
#  904|   		if (stat(name, &fileStat) == 0)
#  905|   		{
#  906|-> 			if (S_ISDIR(fileStat.st_mode))
#  907|   			{
#  908|   				pFileSearch->pDir = opendir(name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/generic.c:924:25: warning[-Wanalyzer-malloc-leak]: leak of ‘file_search_new(lpFileName,  flen - patternlen,  ptr + 1, patternlen)’
#  922|   		}
#  923|   	}
#  924|-> 	if (!pFileSearch->pDir)
#  925|   		goto fail;
#  926|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/generic.c: scope_hint: In function ‘file_search_new’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/file/generic.c:1209:12: warning[-Wanalyzer-malloc-leak]: leak of ‘file_search_new(lpFileName,  flen - patternlen,  ptr + 1, patternlen)’
# 1207|   		 * Disable this return to stop confusing the analyzer. */
# 1208|   #ifndef __clang_analyzer__
# 1209|-> 	if (!is_valid_file_search_handle(hFindFile))
# 1210|   		return FALSE;
# 1211|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetEnvAlloc’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:74:12: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("HOME")’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetEnvAlloc’
#   72|   	nSize = GetEnvironmentVariableX(lpName, NULL, 0);
#   73|   
#   74|-> 	if (nSize > 0)
#   75|   	{
#   76|   		env = malloc(nSize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:74:12: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("TMPDIR")’
#   72|   	nSize = GetEnvironmentVariableX(lpName, NULL, 0);
#   73|   
#   74|-> 	if (nSize > 0)
#   75|   	{
#   76|   		env = malloc(nSize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:74:12: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("XDG_CACHE_HOME")’
#   72|   	nSize = GetEnvironmentVariableX(lpName, NULL, 0);
#   73|   
#   74|-> 	if (nSize > 0)
#   75|   	{
#   76|   		env = malloc(nSize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:74:12: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("XDG_CONFIG_HOME")’
#   72|   	nSize = GetEnvironmentVariableX(lpName, NULL, 0);
#   73|   
#   74|-> 	if (nSize > 0)
#   75|   	{
#   76|   		env = malloc(nSize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:74:12: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("XDG_DATA_HOME")’
#   72|   	nSize = GetEnvironmentVariableX(lpName, NULL, 0);
#   73|   
#   74|-> 	if (nSize > 0)
#   75|   	{
#   76|   		env = malloc(nSize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:74:12: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("XDG_RUNTIME_DIR")’
#   72|   	nSize = GetEnvironmentVariableX(lpName, NULL, 0);
#   73|   
#   74|-> 	if (nSize > 0)
#   75|   	{
#   76|   		env = malloc(nSize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:76:23: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("HOME")’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetEnvAlloc’
#   74|   	if (nSize > 0)
#   75|   	{
#   76|-> 		env = malloc(nSize);
#   77|   
#   78|   		if (!env)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:76:23: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("TMPDIR")’
#   74|   	if (nSize > 0)
#   75|   	{
#   76|-> 		env = malloc(nSize);
#   77|   
#   78|   		if (!env)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:76:23: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("XDG_CACHE_HOME")’
#   74|   	if (nSize > 0)
#   75|   	{
#   76|-> 		env = malloc(nSize);
#   77|   
#   78|   		if (!env)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:76:23: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("XDG_CONFIG_HOME")’
#   74|   	if (nSize > 0)
#   75|   	{
#   76|-> 		env = malloc(nSize);
#   77|   
#   78|   		if (!env)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:76:23: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("XDG_DATA_HOME")’
#   74|   	if (nSize > 0)
#   75|   	{
#   76|-> 		env = malloc(nSize);
#   77|   
#   78|   		if (!env)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:76:23: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvAlloc("XDG_RUNTIME_DIR")’
#   74|   	if (nSize > 0)
#   75|   	{
#   76|-> 		env = malloc(nSize);
#   77|   
#   78|   		if (!env)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetKnownPath’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:76:23: warning[-Wanalyzer-malloc-leak]: leak of ‘GetKnownPath(id)’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetKnownPath’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetKnownPath’
#   74|   	if (nSize > 0)
#   75|   	{
#   76|-> 		env = malloc(nSize);
#   77|   
#   78|   		if (!env)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:394:16: warning[-Wanalyzer-malloc-leak]: leak of ‘GetKnownPath(id)’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetKnownPath’
#  392|   	if (!path)
#  393|   		WLog_WARN(TAG, "Path %s is %p", GetKnownPathIdString(id), path);
#  394|-> 	return path;
#  395|   }
#  396|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetEnvironmentPath’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:415:12: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvironmentPath(name)’
#  413|   	nSize = GetEnvironmentVariableX(name, NULL, 0);
#  414|   
#  415|-> 	if (nSize)
#  416|   	{
#  417|   		env = (LPSTR)malloc(nSize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:417:30: warning[-Wanalyzer-malloc-leak]: leak of ‘GetEnvironmentPath(name)’
#  415|   	if (nSize)
#  416|   	{
#  417|-> 		env = (LPSTR)malloc(nSize);
#  418|   
#  419|   		if (!env)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetCombinedPath’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:463:33: warning[-Wanalyzer-malloc-leak]: leak of ‘GetCombinedPath(GetEnvironmentPath(name), path)’
#  461|   		subPathLength = strlen(subPath);
#  462|   
#  463|-> 	length = basePathLength + subPathLength + 1;
#  464|   	path = (char*)calloc(1, length + 1);
#  465|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c:463:33: warning[-Wanalyzer-malloc-leak]: leak of ‘GetCombinedPath(GetKnownPath(id), path)’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetCombinedPath’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/path/shell.c: scope_hint: In function ‘GetCombinedPath’
#  461|   		subPathLength = strlen(subPath);
#  462|   
#  463|-> 	length = basePathLength + subPathLength + 1;
#  464|   	path = (char*)calloc(1, length + 1);
#  465|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def96]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/sspi/Kerberos/kerberos.c: scope_hint: In function ‘kerberos_AcceptSecurityContext’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/sspi/Kerberos/kerberos.c:1210:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘kerberos_ContextNew(sspi_SecureHandleGetLowerPointer(phCredential))’
# 1208|   		isNewContext = TRUE;
# 1209|   		context = kerberos_ContextNew(credentials);
# 1210|-> 		context->acceptor = TRUE;
# 1211|   
# 1212|   		if (sspi_gss_oid_compare(&oid, &kerberos_u2u_OID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/thread/process.c: scope_hint: In function ‘CreateProcessExA’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/thread/process.c:110:24: warning[-Wanalyzer-malloc-leak]: leak of ‘FindApplicationPath(*pArgs)’
#  108|   		return NULL;
#  109|   
#  110|-> 	if (application[0] == '/')
#  111|   		return _strdup(application);
#  112|   

Error: GCC_ANALYZER_WARNING (CWE-762): [#def98]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/utils/collections/BufferPool.c:342:17: warning[-Wanalyzer-mismatching-deallocation]: ‘buffer’ should have been deallocated with ‘winpr_aligned_free’ but was deallocated with ‘free’
#  340|   		winpr_aligned_free(buffer);
#  341|   	else
#  342|-> 		free(buffer);
#  343|   out_error_no_free:
#  344|   	BufferPool_Unlock(pool);

Error: GCC_ANALYZER_WARNING (CWE-416): [#def99]
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/utils/collections/CountdownEvent.c: scope_hint: In function ‘CountdownEvent_Free’
freerdp-3.9.0-build/FreeRDP-3.9.0/winpr/libwinpr/utils/collections/CountdownEvent.c:207:15: warning[-Wanalyzer-use-after-free]: use after ‘CountdownEvent_Free’ of ‘countdown’
#  205|   
#  206|   	DeleteCriticalSection(&countdown->lock);
#  207|-> 	(void)CloseHandle(countdown->event);
#  208|   
#  209|   	free(countdown);

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.82.0
diffbase-analyzer-version-cppcheck2.16.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer15.0.0
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-240.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-namefreerdp-3.8.0-1.fc41
diffbase-store-results-to/tmp/tmptd7qbj7s/freerdp-3.8.0-1.fc41.tar.xz
diffbase-time-created2024-11-12 23:56:24
diffbase-time-finished2024-11-13 00:06:16
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmptd7qbj7s/freerdp-3.8.0-1.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmptd7qbj7s/freerdp-3.8.0-1.fc41.src.rpm'
diffbase-tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-240.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namefreerdp-3.9.0-1.fc42
store-results-to/tmp/tmpsk0gh83m/freerdp-3.9.0-1.fc42.tar.xz
time-created2024-11-13 00:06:41
time-finished2024-11-13 00:16:14
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpsk0gh83m/freerdp-3.9.0-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpsk0gh83m/freerdp-3.9.0-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9