Newly introduced defects
List of Defects
Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/client/addin.c: scope_hint: In function ‘freerdp_channels_list_dynamic_addins’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/client/addin.c:248:12: warning[-Wanalyzer-malloc-leak]: leak of ‘FindFirstFileUTF8(pszSearchPath, & FindData)’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/client/addin.c:24: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/client/addin.c:223:9: note: in expansion of macro ‘CopyMemory’
# 246| }
# 247|
# 248|-> if (hFind == INVALID_HANDLE_VALUE)
# 249| return ppAddins;
# 250|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/cliprdr/server/cliprdr_main.c: scope_hint: In function ‘cliprdr_server_start’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/cliprdr/server/cliprdr_main.c:1388:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventA(0, 1, 0, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/cliprdr/server/cliprdr_main.c:25: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/cliprdr/server/cliprdr_main.c:1374:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/cliprdr/server/cliprdr_main.c:1377:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:34: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:27: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/cliprdr/server/cliprdr_main.c:1388:36: note: in expansion of macro ‘CreateEvent’
# 1386| }
# 1387|
# 1388|-> if (!(cliprdr->StopEvent = CreateEvent(NULL, TRUE, FALSE, NULL)))
# 1389| {
# 1390| WLog_ERR(TAG, "CreateEvent failed!");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/cliprdr/server/cliprdr_main.c:1394:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateThread(0, 0, &cliprdr_server_thread, context, 0, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/cliprdr/server/cliprdr_main.c:1374:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/cliprdr/server/cliprdr_main.c:1377:9: note: in expansion of macro ‘WINPR_ASSERT’
# 1392| }
# 1393|
# 1394|-> if (!(cliprdr->Thread = CreateThread(NULL, 0, cliprdr_server_thread, (void*)context, 0, NULL)))
# 1395| {
# 1396| WLog_ERR(TAG, "CreateThread failed!");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/drive/client/drive_file.c: scope_hint: In function ‘drive_file_query_information’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/drive/client/drive_file.c:558:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateFileW(*file.fullpath, 0, 4, 0, 3, 128, 0)’
# 556| hFile = CreateFileW(file->fullpath, 0, FILE_SHARE_DELETE, NULL, OPEN_EXISTING,
# 557| FILE_ATTRIBUTE_NORMAL, NULL);
# 558|-> if (hFile != INVALID_HANDLE_VALUE)
# 559| {
# 560| status = GetFileInformationByHandle(hFile, &fileInformation);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c: scope_hint: In function ‘printer_write_setting’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:120:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateFileA(GetCombinedPath(path, name), 1073741824, 0, 0, 2, 128, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/channels/rdpdr.h:36: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:39: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/api.h:32:9: note: in definition of macro ‘FREERDP_ENTRY_POINT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:31: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:1130:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:1140:17: note: in expansion of macro ‘WINPR_ASSERT’
# 118| free(abs);
# 119|
# 120|-> if (file == INVALID_HANDLE_VALUE)
# 121| return FALSE;
# 122|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c: scope_hint: In function ‘printer_read_setting’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:175:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateFileA(GetCombinedPath(path, name), 2147483648, 0, 0, 3, 128, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:957:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:958:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:958:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/crt.h:31: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:30: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/printer/client/printer_main.c:973:9: note: in expansion of macro ‘sprintf_s’
# 173| free(abs);
# 174|
# 175|-> if (file == INVALID_HANDLE_VALUE)
# 176| return FALSE;
# 177|
Error: CPPCHECK_WARNING: [#def7]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/rail/rail_common.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/rail/server/rail_main.c: scope_hint: In function ‘rail_server_start’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/rail/server/rail_main.c:1446:21: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventA(0, 1, 0, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/collections.h:32: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/types.h:139: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/rail/server/rail_main.c:21: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/rail/server/rail_main.c:1442:9: note: in expansion of macro ‘CopyMemory’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:34: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:27: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/collections.h:30: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/rail/server/rail_main.c:1444:36: note: in expansion of macro ‘CreateEvent’
# 1444| context->priv->stopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
# 1445|
# 1446|-> if (!context->priv->stopEvent)
# 1447| {
# 1448| WLog_ERR(TAG, "CreateEvent failed!");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c: scope_hint: In function ‘serial_process_irp_create’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:174:12: warning[-Wanalyzer-malloc-leak]: leak of ‘*serial.hComm’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/collections.h:34: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:31: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:132:9: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:132:9: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:24: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:217:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:218:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:132:9: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h: scope_hint: In function ‘serial_process_irp_create’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c: scope_hint: In function ‘serial_process_irp_create’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h: scope_hint: In function ‘serial_process_irp_create’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c: scope_hint: In function ‘serial_process_irp_create’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:135:9: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:217:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:218:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:135:9: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:136:9: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:217:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:218:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:136:9: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h: scope_hint: In function ‘serial_process_irp_create’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c: scope_hint: In function ‘serial_process_irp_create’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:138:9: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:217:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:218:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:138:9: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:143:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:143:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:27: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:160:9: note: in expansion of macro ‘WLog_Print’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/comm.h:27: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:32: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:170:13: note: in expansion of macro ‘CreateFile’
# 172| NULL); /* TemplateFile */
# 173|
# 174|-> if (!serial->hComm || (serial->hComm == INVALID_HANDLE_VALUE))
# 175| {
# 176| WLog_Print(serial->log, WLOG_WARN, "CreateFile failure: %s last-error: 0x%08" PRIX32 "",
Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c: scope_hint: In function ‘create_irp_thread’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:643:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateThread(0, 0, &irp_thread_func, data, 0, 0)’
# 641| irpThread = CreateThread(NULL, 0, irp_thread_func, (void*)data, 0, NULL);
# 642|
# 643|-> if (irpThread == INVALID_HANDLE_VALUE)
# 644| {
# 645| WLog_Print(serial->log, WLOG_WARN, "Could not allocate a new IRP thread.");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/serial/client/serial_main.c:651:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateThread(0, 0, &irp_thread_func, data, 0, 0)’
# 649| key = irp->CompletionId + 1ull;
# 650|
# 651|-> if (!ListDictionary_Add(serial->IrpThreads, (void*)key, irpThread))
# 652| {
# 653| WLog_ERR(TAG, "ListDictionary_Add failed!");
Error: GCC_ANALYZER_WARNING (CWE-688): [#def12]
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/urbdrc/client/libusb/libusb_udevice.c: scope_hint: In function ‘func_iso_callback’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/urbdrc/client/libusb/libusb_udevice.c:284:49: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:716:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/urbdrc/client/libusb/libusb_udevice.c: scope_hint: In function ‘func_iso_callback’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:595:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:596:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:597:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:595:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:596:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:597:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:595:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:596:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:597:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/channels/urbdrc/client/libusb/libusb_udevice.c: scope_hint: In function ‘func_iso_callback’
<built-in>: note: argument 2 of ‘__builtin_memmove’ must be non-null
# 282|
# 283| if (data != packetBuffer)
# 284|-> memmove(data, packetBuffer, act_len);
# 285|
# 286| index += act_len;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c: scope_hint: In function ‘xf_setup_x11’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1857:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateMutexA(0, 0, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:28: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1101:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1105:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1108:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1823:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:27: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:204:29: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1850:17: note: in expansion of macro ‘WLog_INFO’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:34: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1855:22: note: in expansion of macro ‘CreateMutex’
# 1855| xfc->mutex = CreateMutex(NULL, FALSE, NULL);
# 1856|
# 1857|-> if (!xfc->mutex)
# 1858| {
# 1859| WLog_ERR(TAG, "Could not create mutex!");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1933:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateFileDescriptorEventA(0, 0, 0, *xfc.xfds, 1)’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1101:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1105:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1108:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1823:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:204:29: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1850:17: note: in expansion of macro ‘WLog_INFO’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_client.c:1931:25: note: in expansion of macro ‘CreateFileDescriptorEvent’
# 1931| xfc->x11event = CreateFileDescriptorEvent(NULL, FALSE, FALSE, xfc->xfds, WINPR_FD_READ);
# 1932|
# 1933|-> if (!xfc->x11event)
# 1934| {
# 1935| WLog_ERR(TAG, "Could not create xfds event");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_cliprdr.c: scope_hint: In function ‘xf_cliprdr_server_format_data_response’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_cliprdr.c:195:31: warning[-Wanalyzer-malloc-leak]: leak of ‘xf_cached_data_new_copy(data, (long unsigned int)size)’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_cliprdr.c:35: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_cliprdr.c:2015:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_cliprdr.c:2016:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_cliprdr.c:2016:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_cliprdr.c:2019:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/X11/xf_cliprdr.c:2022:9: note: in expansion of macro ‘WINPR_ASSERT’
# 193| }
# 194|
# 195|-> xfCachedData* cache = xf_cached_data_new(copy, data_length);
# 196| if (!cache)
# 197| free(copy);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c: scope_hint: In function ‘is_directory’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2191:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateFileW(ConvertUtf8ToWCharAlloc(path, 0), 0, 4, 0, 3, 128, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:42: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2151:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2133:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2134:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2134:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2135:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2135:9: note: in expansion of macro ‘WINPR_ASSERT’
# 2189| free(wpath);
# 2190|
# 2191|-> if (hFile == INVALID_HANDLE_VALUE)
# 2192| return FALSE;
# 2193|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c: scope_hint: In function ‘add_directory’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2217:12: warning[-Wanalyzer-malloc-leak]: leak of ‘FindFirstFileW(ConvertUtf8ToWCharAlloc(GetCombinedPath(path, "*"), 0), &FindFileData)’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2151:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2133:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2134:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2134:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2135:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/client/common/client_cliprdr_file.c:2135:9: note: in expansion of macro ‘WINPR_ASSERT’
# 2215| free(wpath);
# 2216|
# 2217|-> if (hFind == INVALID_HANDLE_VALUE)
# 2218| return FALSE;
# 2219|
Error: GCC_ANALYZER_WARNING (CWE-762): [#def18]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/clear.c: scope_hint: In function ‘clear_context_new’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/clear.c:1180:9: warning[-Wanalyzer-mismatching-deallocation]: ‘winpr_aligned_calloc(1, 850496, 32)’ should have been deallocated with ‘winpr_aligned_free’ but was deallocated with ‘clear_context_free’
# 1178| WINPR_PRAGMA_DIAG_PUSH
# 1179| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 1180|-> clear_context_free(clear);
# 1181| WINPR_PRAGMA_DIAG_POP
# 1182| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/h264.c: scope_hint: In function ‘avc444_ensure_buffer’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/h264.c:435:90: warning[-Wanalyzer-malloc-leak]: leak of ‘*((BYTE * (*)[3])<unknown>)[0]’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/bitstream.h:23: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/h264.c:26: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/h264.c:405:9: note: in expansion of macro ‘WINPR_ASSERT’
# 433| return FALSE;
# 434| ppYUVDstData[x] = tmp1;
# 435|-> BYTE* tmp2 = winpr_aligned_recalloc(ppOldYUVDstData[x], piDstSize[x], 1, 16);
# 436| if (!tmp2)
# 437| return FALSE;
Error: GCC_ANALYZER_WARNING (CWE-762): [#def20]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/interleaved.c: scope_hint: In function ‘bitmap_interleaved_context_new’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/interleaved.c:740:9: warning[-Wanalyzer-mismatching-deallocation]: ‘winpr_aligned_recalloc(0, 1, 24, 32)’ should have been deallocated with ‘winpr_aligned_free’ but was deallocated with ‘bitmap_interleaved_context_free’
# 738| WINPR_PRAGMA_DIAG_PUSH
# 739| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 740|-> bitmap_interleaved_context_free(interleaved);
# 741| WINPR_PRAGMA_DIAG_POP
# 742| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c: scope_hint: In function ‘nsc_context_initialize’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:292:44: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_recalloc(*context_53(D)->priv.PlaneBuffers[i], plength, 1, 32)’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/collections.h:30: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/types.h:139: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/codec/nsc.h:27: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:31: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:240:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:241:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/collections.h:34: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:116:9: note: in expansion of macro ‘Stream_CheckAndLogRequiredLengthOfSizeWLog’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:242:14: note: in expansion of macro ‘Stream_CheckAndLogRequiredLengthWLog’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:248:17: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:248:17: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:217:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:218:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:248:17: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:248:17: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:248:17: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:217:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:218:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:248:17: note: in expansion of macro ‘Stream_Read_UINT32’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:252:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:252:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:260:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:260:9: note: in expansion of macro ‘Stream_Read_UINT8’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:716:17: note: in expansion of macro ‘WINPR_ASSERT’
# 290| if (plength > context->priv->PlaneBuffersLength)
# 291| {
# 292|-> for (size_t i = 0; i < 4; i++)
# 293| {
# 294| void* tmp = (BYTE*)winpr_aligned_recalloc(context->priv->PlaneBuffers[i], plength,
Error: GCC_ANALYZER_WARNING (CWE-762): [#def22]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c: scope_hint: In function ‘nsc_context_new’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc.c:375:9: warning[-Wanalyzer-mismatching-deallocation]: ‘winpr_aligned_calloc(1, 120, 32)’ should have been deallocated with ‘winpr_aligned_free’ but was deallocated with ‘nsc_context_free’
# 373| WINPR_PRAGMA_DIAG_PUSH
# 374| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 375|-> nsc_context_free(context);
# 376| WINPR_PRAGMA_DIAG_POP
# 377| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc_encode.c: scope_hint: In function ‘nsc_context_initialize_encode’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/nsc_encode.c:71:41: warning[-Wanalyzer-malloc-leak]: leak of ‘*context_47(D)->priv.PlaneBuffers[i]’
# 69| if (length > context->priv->PlaneBuffersLength)
# 70| {
# 71|-> for (int i = 0; i < 5; i++)
# 72| {
# 73| BYTE* tmp = (BYTE*)winpr_aligned_recalloc(context->priv->PlaneBuffers[i], length,
Error: GCC_ANALYZER_WARNING (CWE-762): [#def24]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/planar.c: scope_hint: In function ‘freerdp_bitmap_planar_context_new’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/planar.c:1752:17: warning[-Wanalyzer-mismatching-deallocation]: ‘winpr_aligned_calloc(1, 176, 32)’ should have been deallocated with ‘winpr_aligned_free’ but was deallocated with ‘freerdp_bitmap_planar_context_free’
# 1750| WINPR_PRAGMA_DIAG_PUSH
# 1751| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 1752|-> freerdp_bitmap_planar_context_free(context);
# 1753| WINPR_PRAGMA_DIAG_POP
# 1754| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-762): [#def25]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/progressive.c:2645:9: warning[-Wanalyzer-mismatching-deallocation]: ‘winpr_aligned_calloc(1, 1059208, 32)’ should have been deallocated with ‘winpr_aligned_free’ but was deallocated with ‘progressive_context_free’
# 2643| WINPR_PRAGMA_DIAG_PUSH
# 2644| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 2645|-> progressive_context_free(progressive);
# 2646| WINPR_PRAGMA_DIAG_POP
# 2647| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/progressive.c: scope_hint: In function ‘progressive_context_new_ex’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/progressive.c:2655:9: warning[-Wanalyzer-malloc-leak]: leak of ‘progressive_context_new_ex(Compressor, 0)’
# 2653| return;
# 2654|
# 2655|-> Stream_Free(progressive->buffer, TRUE);
# 2656| Stream_Free(progressive->rects, TRUE);
# 2657| rfx_context_free(progressive->rfx_context);
Error: GCC_ANALYZER_WARNING (CWE-126): [#def27]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/region.c:623:38: warning[-Wanalyzer-out-of-bounds]: buffer over-read
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/region.c:730:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/region.c:731:9: note: in expansion of macro ‘WINPR_ASSERT’
# 621| }
# 622|
# 623|-> topInterBand = currentBand->bottom;
# 624| }
# 625|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c: scope_hint: In function ‘rfx_allocate_tiles’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:809:13: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_recalloc(*message.tiles, count, 8, 32)’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:24: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:2141:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1632:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1633:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1633:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1634:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1634:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1635:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1635:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1636:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1636:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1637:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1637:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1562:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1673:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1674:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1579:22: note: in definition of macro ‘TILE_NO’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1608:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/settings.h:32: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:35: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/types.h:32:22: note: in definition of macro ‘MAX’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:806:9: note: in expansion of macro ‘WINPR_ASSERT’
# 807|
# 808| RFX_TILE** tmpTiles = winpr_aligned_recalloc(message->tiles, count, sizeof(RFX_TILE*), 32);
# 809|-> if (!tmpTiles && (count != 0))
# 810| return FALSE;
# 811|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c: scope_hint: In function ‘rfx_message_free.part.0’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1426:18: warning[-Wanalyzer-malloc-leak]: leak of ‘*message.tiles’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:806:9: note: in expansion of macro ‘WINPR_ASSERT’
# 1424| const BOOL freeArray = message->freeArray;
# 1425| const RFX_MESSAGE empty = { 0 };
# 1426|-> *message = empty;
# 1427|
# 1428| if (!freeArray)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c: scope_hint: In function ‘rfx_encode_message’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1648:36: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_calloc(1, 64, 32)’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:2141:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1632:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1633:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1633:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1634:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1634:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1635:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1635:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1636:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1636:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1637:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/rfx.c:1637:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:23: note: in definition of macro ‘WINPR_ASSERT’
# 1646| rfx_update_context_properties(context);
# 1647|
# 1648|-> message->frameIdx = context->frameIdx++;
# 1649|
# 1650| if (!context->numQuant)
Error: COMPILER_WARNING (CWE-1164): [#def31]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/zgfx.c:380:14: warning[-Wunused-function]: ‘aligned_zgfx_malloc’ defined but not used
# 380 | static BYTE* aligned_zgfx_malloc(size_t size)
# | ^~~~~~~~~~~~~~~~~~~
# 378| * out of bounds read.
# 379| */
# 380|-> static BYTE* aligned_zgfx_malloc(size_t size)
# 381| {
# 382| return malloc(size + 64);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/childsession.c: scope_hint: In function ‘createChildSessionTransport’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/childsession.c:509:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateFileW(&pipePath, 3221225472, 0, 0, 3, 1073741824, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/childsession.c:441:9: note: in expansion of macro ‘WINPR_ASSERT’
# 507| HANDLE f = CreateFileW(pipePath, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
# 508| FILE_FLAG_OVERLAPPED, NULL);
# 509|-> if (f == INVALID_HANDLE_VALUE)
# 510| {
# 511| WLog_ERR(TAG, "error when connecting to local named pipe");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/listener.c: scope_hint: In function ‘freerdp_listener_open’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/listener.c:221:47: warning[-Wanalyzer-malloc-leak]: leak of ‘WSACreateEvent()’
# 219| listener->events[listener->num_sockfds] = WSACreateEvent();
# 220|
# 221|-> if (!listener->events[listener->num_sockfds])
# 222| {
# 223| listener->num_sockfds = 0;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/listener.c: scope_hint: In function ‘freerdp_listener_open_local’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/listener.c:300:30: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateFileDescriptorEventA(0, 0, 0, sockfd, 1)’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:34: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/log.h:23: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/listener.c:30: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/listener.c:289:18: note: in expansion of macro ‘CreateFileDescriptorEvent’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/listener.c:289:18: note: in expansion of macro ‘CreateFileDescriptorEvent’
# 298| listener->sockfds[listener->num_sockfds] = sockfd;
# 299| listener->events[listener->num_sockfds] = hevent;
# 300|-> listener->num_sockfds++;
# 301| WLog_INFO(TAG, "Listening on socket %s.", addr.sun_path);
# 302| return TRUE;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/listener.c: scope_hint: In function ‘freerdp_listener_open_from_socket’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/listener.c:325:39: warning[-Wanalyzer-malloc-leak]: leak of ‘WSACreateEvent()’
# 323| listener->events[listener->num_sockfds] = WSACreateEvent();
# 324|
# 325|-> if (!listener->events[listener->num_sockfds])
# 326| return FALSE;
# 327|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/transport.c:1617:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/transport.c:1554:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:34: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:27: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/transport.c:1587:37: note: in expansion of macro ‘CreateEvent’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/core/transport.c:1587:37: note: in expansion of macro ‘CreateEvent’
# 1615| WINPR_PRAGMA_DIAG_PUSH
# 1616| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 1617|-> transport_free(transport);
# 1618| WINPR_PRAGMA_DIAG_POP
# 1619| return NULL;
Error: COMPILER_WARNING (CWE-704): [#def37]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/emu/scard/smartcard_emulate.c: scope_hint: In function ‘Emulate_SCardGetStatusChangeA’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/emu/scard/smartcard_emulate.c:1367:68: warning[-Wdiscarded-qualifiers]: passing argument 1 of ‘freerdp_settings_get_pointer_writable’ discards ‘const’ qualifier from pointer target type
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/freerdp.h:32: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/emu/scard/smartcard_emulate.c:22: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/settings.h:548:78: note: expected ‘rdpSettings *’ {aka ‘struct rdp_settings *’} but argument is of type ‘const rdpSettings *’ {aka ‘const struct rdp_settings *’}
# 1365|
# 1366| freerdp* inst =
# 1367|-> freerdp_settings_get_pointer_writable(smartcard->settings, FreeRDP_instance);
# 1368| WINPR_ASSERT(inst);
# 1369|
Error: COMPILER_WARNING (CWE-704): [#def38]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/emu/scard/smartcard_emulate.c: scope_hint: In function ‘Emulate_SCardGetStatusChangeW’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/emu/scard/smartcard_emulate.c:1450:68: warning[-Wdiscarded-qualifiers]: passing argument 1 of ‘freerdp_settings_get_pointer_writable’ discards ‘const’ qualifier from pointer target type
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/settings.h:548:78: note: expected ‘rdpSettings *’ {aka ‘struct rdp_settings *’} but argument is of type ‘const rdpSettings *’ {aka ‘const struct rdp_settings *’}
# 1448|
# 1449| freerdp* inst =
# 1450|-> freerdp_settings_get_pointer_writable(smartcard->settings, FreeRDP_instance);
# 1451| WINPR_ASSERT(inst);
# 1452|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
freerdp-3.5.1-build/FreeRDP-3.5.1/server/proxy/pf_context.c: scope_hint: In function ‘client_to_proxy_context_free’
freerdp-3.5.1-build/FreeRDP-3.5.1/server/proxy/pf_context.c:183:22: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/stream.h:30: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/server/proxy/proxy_modules_api.h:29: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/server/proxy/proxy_config.h:27: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/include/freerdp/server/proxy/proxy_server.h:24: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/server/proxy/pf_context.c:109:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/server/proxy/pf_context.c:110:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/server/proxy/pf_context.c:110:9: note: in expansion of macro ‘WINPR_ASSERT’
# 181| if (context->vcm && (context->vcm != INVALID_HANDLE_VALUE))
# 182| WTSCloseServer((HANDLE)context->vcm);
# 183|-> context->vcm = NULL;
# 184| }
# 185|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
freerdp-3.5.1-build/FreeRDP-3.5.1/server/proxy/pf_context.c:334:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
freerdp-3.5.1-build/FreeRDP-3.5.1/server/proxy/pf_context.c:308:36: note: in expansion of macro ‘CreateEvent’
freerdp-3.5.1-build/FreeRDP-3.5.1/server/proxy/pf_context.c:308:36: note: in expansion of macro ‘CreateEvent’
freerdp-3.5.1-build/FreeRDP-3.5.1/server/proxy/pf_context.c:311:41: note: in expansion of macro ‘CreateEvent’
# 332| WINPR_PRAGMA_DIAG_PUSH
# 333| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 334|-> proxy_data_free(pdata);
# 335| WINPR_PRAGMA_DIAG_POP
# 336| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/progressive.c:24: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/assert.h:38:20: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_calloc(1, 1059208, 32)’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/progressive.c:2638:17: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/libfreerdp/codec/progressive.c:2638:17: note: in expansion of macro ‘WINPR_ASSERT’
# 36| do \
# 37| { \
# 38|-> if (!(cond)) \
# 39| winpr_int_assert(#cond, __FILE__, __func__, __LINE__); \
# 40| } while (0)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/debug.h:31: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/semaphore.c:21: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:150:21: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateSemaphoreW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:206:28: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/semaphore.c:147:17: note: in expansion of macro ‘WLog_ERR’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:206:28: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/semaphore.c:147:17: note: in expansion of macro ‘WLog_ERR’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/wlog.h:206:28: note: in expansion of macro ‘WLog_Print_tag’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/semaphore.c:147: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): [#def43]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c: scope_hint: In function ‘make_synthetic_file’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:83:12: warning[-Wanalyzer-malloc-leak]: leak of ‘FindFirstFileW(local_name, & fd)’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c: scope_hint: In function ‘make_synthetic_file’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/collections.h:30: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:36: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:569:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:573:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:390:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:364:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:365:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:365:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:366:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:366:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:347:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:143:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:312:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:313:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:313:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:314:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:314:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:315:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:315:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:79:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:80:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:80:9: note: in expansion of macro ‘WINPR_ASSERT’
# 81|
# 82| hFind = FindFirstFileW(local_name, &fd);
# 83|-> if (INVALID_HANDLE_VALUE == hFind)
# 84| {
# 85| WLog_ERR(TAG, "FindFirstFile failed (%" PRIu32 ")", GetLastError());
Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c: scope_hint: In function ‘do_add_directory_contents_to_list’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:248:12: warning[-Wanalyzer-malloc-leak]: leak of ‘FindFirstFileW(namebuf, & FindData)’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c: scope_hint: In function ‘do_add_directory_contents_to_list’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:569:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:573:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:390:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:364:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:365:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:365:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:366:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:366:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:347:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:143:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:312:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:313:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:313:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:314:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:314:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:315:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:315:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:79:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:80:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:80:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:288:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:289:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:289:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:290:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:290:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:291:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:291:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:240:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:241:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:241:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:242:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:242:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:243:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:243:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:244:9: note: in expansion of macro ‘WINPR_ASSERT’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/clipboard/synthetic_file.c:244:9: note: in expansion of macro ‘WINPR_ASSERT’
# 246| WIN32_FIND_DATAW FindData = { 0 };
# 247| HANDLE hFind = FindFirstFileW(namebuf, &FindData);
# 248|-> if (INVALID_HANDLE_VALUE == hFind)
# 249| {
# 250| WLog_ERR(TAG, "FindFirstFile failed (%" PRIu32 ")", GetLastError());
Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/comm/comm.c: scope_hint: In function ‘CommCreateFileA’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/comm/comm.c:1348:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/comm/comm.c:1075:13: note: in expansion of macro ‘_tcslen’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/comm/comm.c:1081:9: note: in expansion of macro ‘_tcscpy’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/comm/comm.c:33: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/comm/comm.c: scope_hint: In function ‘CommCreateFileA’
# 1346| WINPR_PRAGMA_DIAG_PUSH
# 1347| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 1348|-> CloseHandle(pComm);
# 1349| WINPR_PRAGMA_DIAG_POP
# 1350| return INVALID_HANDLE_VALUE;
Error: GCC_ANALYZER_WARNING (CWE-762): [#def46]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/comm/comm.c:1348:9: warning[-Wanalyzer-mismatching-deallocation]: ‘pComm’ should have been deallocated with ‘free’ but was deallocated with ‘CloseHandle’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/comm/comm.c:1075:13: note: in expansion of macro ‘_tcslen’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/comm/comm.c:1081:9: note: in expansion of macro ‘_tcscpy’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/comm/comm.c: scope_hint: In function ‘CommCreateFileA’
# 1346| WINPR_PRAGMA_DIAG_PUSH
# 1347| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 1348|-> CloseHandle(pComm);
# 1349| WINPR_PRAGMA_DIAG_POP
# 1350| return INVALID_HANDLE_VALUE;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c:80:23: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_offset_malloc(num * size, alignment, offset)’
# 78|
# 79| /* alignment must be a power of 2 */
# 80|-> if (alignment % 2 == 1)
# 81| return NULL;
# 82|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c: scope_hint: In function ‘winpr_aligned_offset_malloc’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c:80:23: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_offset_malloc(size, alignment, offset)’
# 78|
# 79| /* alignment must be a power of 2 */
# 80|-> if (alignment % 2 == 1)
# 81| return NULL;
# 82|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c: scope_hint: In function ‘winpr_aligned_offset_realloc’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c:80:23: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_offset_realloc(memblock, size, alignment, 0)’
# 78|
# 79| /* alignment must be a power of 2 */
# 80|-> if (alignment % 2 == 1)
# 81| return NULL;
# 82|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c:141:17: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_offset_realloc(memblock, size, alignment, 0)’
# 139| pMem = WINPR_ALIGNED_MEM_STRUCT_FROM_PTR(memblock);
# 140|
# 141|-> if (pMem->sig != WINPR_ALIGNED_MEM_SIGNATURE)
# 142| {
# 143| WLog_ERR(TAG,
Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c: scope_hint: In function ‘winpr_aligned_offset_recalloc’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c:182:31: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_offset_recalloc(memblock, num, size, alignment, 0)’
# 180| if (!memblock)
# 181| {
# 182|-> newMemblock = winpr_aligned_offset_malloc(size * num, alignment, offset);
# 183|
# 184| if (newMemblock)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c: scope_hint: In function ‘winpr_aligned_recalloc’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c:182:31: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_recalloc(0, count, size, alignment)’
# 180| if (!memblock)
# 181| {
# 182|-> newMemblock = winpr_aligned_offset_malloc(size * num, alignment, offset);
# 183|
# 184| if (newMemblock)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c: scope_hint: In function ‘winpr_aligned_offset_recalloc’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c:195:17: warning[-Wanalyzer-malloc-leak]: leak of ‘winpr_aligned_offset_recalloc(memblock, num, size, alignment, 0)’
# 193| pMem = WINPR_ALIGNED_MEM_STRUCT_FROM_PTR(memblock);
# 194|
# 195|-> if (pMem->sig != WINPR_ALIGNED_MEM_SIGNATURE)
# 196| {
# 197| WLog_ERR(TAG,
Error: GCC_ANALYZER_WARNING (CWE-416): [#def54]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c: scope_hint: In function ‘winpr_aligned_free’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/crt/alignment.c:251:17: warning[-Wanalyzer-use-after-free]: use after ‘winpr_aligned_free’ of ‘memblock’
# 249| pMem = WINPR_ALIGNED_MEM_STRUCT_FROM_PTR(memblock);
# 250|
# 251|-> if (pMem->sig != WINPR_ALIGNED_MEM_SIGNATURE)
# 252| {
# 253| WLog_ERR(TAG, "_aligned_free: memory block was not allocated by _aligned_malloc!");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:526:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:996:24: note: in expansion of macro ‘INVALID_HANDLE_VALUE’
# 524| return INVALID_FILE_ATTRIBUTES;
# 525|
# 526|-> FindClose(hFind);
# 527| return findFileData.dwFileAttributes;
# 528| }
Error: GCC_ANALYZER_WARNING (CWE-762): [#def56]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:526:9: warning[-Wanalyzer-mismatching-deallocation]: ‘FindFirstFileA(lpFileName, & findFileData)’ should have been deallocated with ‘free’ but was deallocated with ‘FindClose’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:996:24: note: in expansion of macro ‘INVALID_HANDLE_VALUE’
# 524| return INVALID_FILE_ATTRIBUTES;
# 525|
# 526|-> FindClose(hFind);
# 527| return findFileData.dwFileAttributes;
# 528| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c: scope_hint: In function ‘file_search_new’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:930:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 928| WINPR_PRAGMA_DIAG_PUSH
# 929| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 930|-> FindClose(pFileSearch);
# 931| WINPR_PRAGMA_DIAG_POP
# 932| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-762): [#def58]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:930:9: warning[-Wanalyzer-mismatching-deallocation]: ‘pFileSearch’ should have been deallocated with ‘free’ but was deallocated with ‘FindClose’
# 928| WINPR_PRAGMA_DIAG_PUSH
# 929| WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
# 930|-> FindClose(pFileSearch);
# 931| WINPR_PRAGMA_DIAG_POP
# 932| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c: scope_hint: In function ‘FindFirstFileA’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:993:13: warning[-Wanalyzer-malloc-leak]: leak of ‘FindFirstFileA(ConvertWCharToUtf8Alloc(lpFileName, 0), fd)’
# 991| HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData)
# 992| {
# 993|-> if (!lpFindFileData || !lpFileName)
# 994| {
# 995| SetLastError(ERROR_BAD_ARGUMENTS);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:993:13: warning[-Wanalyzer-malloc-leak]: leak of ‘FindFirstFileA(lpFileName, & findFileData)’
# 991| HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData)
# 992| {
# 993|-> if (!lpFindFileData || !lpFileName)
# 994| {
# 995| SetLastError(ERROR_BAD_ARGUMENTS);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c: scope_hint: In function ‘FindFirstFileA’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:1025:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 1023|
# 1024| fail:
# 1025|-> FindClose(pFileSearch);
# 1026| return INVALID_HANDLE_VALUE;
# 1027| }
Error: GCC_ANALYZER_WARNING (CWE-762): [#def62]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:1025:9: warning[-Wanalyzer-mismatching-deallocation]: ‘pFileSearch’ should have been deallocated with ‘free’ but was deallocated with ‘FindClose’
# 1023|
# 1024| fail:
# 1025|-> FindClose(pFileSearch);
# 1026| return INVALID_HANDLE_VALUE;
# 1027| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c: scope_hint: In function ‘FindFirstFileW’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:1079:12: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:996:24: note: in expansion of macro ‘INVALID_HANDLE_VALUE’
# 1077| free(utfFileName);
# 1078|
# 1079|-> if (h != INVALID_HANDLE_VALUE)
# 1080| {
# 1081| if (!ConvertFindDataAToW(fd, lpFindFileData))
Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:1084:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:996:24: note: in expansion of macro ‘INVALID_HANDLE_VALUE’
# 1082| {
# 1083| SetLastError(ERROR_NOT_ENOUGH_MEMORY);
# 1084|-> FindClose(h);
# 1085| h = INVALID_HANDLE_VALUE;
# 1086| goto out;
Error: GCC_ANALYZER_WARNING (CWE-762): [#def65]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:1084:25: warning[-Wanalyzer-mismatching-deallocation]: ‘FindFirstFileA(ConvertWCharToUtf8Alloc(lpFileName, 0), fd)’ should have been deallocated with ‘free’ but was deallocated with ‘FindClose’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:996:24: note: in expansion of macro ‘INVALID_HANDLE_VALUE’
# 1082| {
# 1083| SetLastError(ERROR_NOT_ENOUGH_MEMORY);
# 1084|-> FindClose(h);
# 1085| h = INVALID_HANDLE_VALUE;
# 1086| goto out;
Error: GCC_ANALYZER_WARNING (CWE-416): [#def66]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:1212:25: warning[-Wanalyzer-use-after-free]: use after ‘FindClose’ of ‘hFindFile’
# 1210| #endif
# 1211|
# 1212|-> free(pFileSearch->lpPath);
# 1213| free(pFileSearch->lpPattern);
# 1214|
Error: GCC_ANALYZER_WARNING (CWE-457): [#def67]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c: scope_hint: In function ‘FindClose’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/file/generic.c:1212:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(WIN32_FILE_SEARCH *)hFindFile.lpPath’
# 1210| #endif
# 1211|
# 1212|-> free(pFileSearch->lpPath);
# 1213| free(pFileSearch->lpPattern);
# 1214|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/handle/handle.h:141:19: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateSemaphoreW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/semaphore.c: scope_hint: In function ‘CreateSemaphoreW’
# 139|
# 140| hdl->Type = _type;
# 141|-> hdl->Mode = _mode;
# 142| }
# 143|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/path/path.c: scope_hint: In function ‘winpr_RemoveDirectory_RecursiveW’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/path/path.c:1141:12: warning[-Wanalyzer-malloc-leak]: leak of ‘FindFirstFileW(path_slash, & findFileData)’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/path/include/PathCchAppend.c:11:9: note: in expansion of macro ‘PATH_CCH_APPEND’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/path/path.c:341: included_from: Included from here.
# 1139| dir = FindFirstFileW(path_slash, &findFileData);
# 1140|
# 1141|-> if (dir == INVALID_HANDLE_VALUE)
# 1142| goto fail;
# 1143|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/pool/pool.c: scope_hint: In function ‘InitializeThreadpool’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/pool/pool.c:138:22: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateThread(0, 0, &thread_pool_work_func, pool, 0, 0)’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/pool.h:26: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/pool/pool.c:23: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/pool/pool.c:122:38: note: in expansion of macro ‘CreateEvent’
# 136| }
# 137|
# 138|-> if (!ArrayList_Append(pool->Threads, thread))
# 139| {
# 140| CloseHandle(thread);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/pool/pool.c: scope_hint: In function ‘winpr_SetThreadpoolThreadMinimum’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/pool/pool.c:228:22: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateThread(0, 0, &thread_pool_work_func, ptpp, 0, 0)’
# 226| }
# 227|
# 228|-> if (!ArrayList_Append(ptpp->Threads, thread))
# 229| {
# 230| CloseHandle(thread);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:211:18: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventA(lpEventAttributes, bManualReset, bInitialState, name)’
# 209| return FALSE;
# 210|
# 211|-> if (event->bAttached)
# 212| {
# 213| // don't close attached file descriptor
Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c: scope_hint: In function ‘CreateEventA’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:211:18: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventA(lpEventAttributes, manual, initial, lpName)’
# 209| return FALSE;
# 210|
# 211|-> if (event->bAttached)
# 212| {
# 213| // don't close attached file descriptor
Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c: scope_hint: In function ‘CreateEventW’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:211:18: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventW(lpEventAttributes, manual, initial, lpName)’
# 209| return FALSE;
# 210|
# 211|-> if (event->bAttached)
# 212| {
# 213| // don't close attached file descriptor
Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:278:20: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventW(lpEventAttributes, manual, initial, lpName)’
# 276| {
# 277| name = ConvertWCharToUtf8Alloc(lpName, NULL);
# 278|-> if (!name)
# 279| return NULL;
# 280| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:283:9: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventW(lpEventAttributes, manual, initial, lpName)’
# 281|
# 282| handle = CreateEventA(lpEventAttributes, bManualReset, bInitialState, name);
# 283|-> free(name);
# 284| return handle;
# 285| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:295:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventA(lpEventAttributes, bManualReset, bInitialState, name)’
# 293| WLog_WARN(TAG, "[%s] does not support lpEventAttributes", lpName);
# 294|
# 295|-> if (!event)
# 296| return NULL;
# 297|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c: scope_hint: In function ‘CreateEventA’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:295:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventA(lpEventAttributes, manual, initial, lpName)’
# 293| WLog_WARN(TAG, "[%s] does not support lpEventAttributes", lpName);
# 294|
# 295|-> if (!event)
# 296| return NULL;
# 297|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:314:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventA(lpEventAttributes, bManualReset, bInitialState, name)’
# 312| goto fail;
# 313|
# 314|-> if (bInitialState)
# 315| {
# 316| if (!SetEvent(event))
Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:314:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateEventA(lpEventAttributes, manual, initial, lpName)’
# 312| goto fail;
# 313|
# 314|-> if (bInitialState)
# 315| {
# 316| if (!SetEvent(event))
Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c: scope_hint: In function ‘CreateFileDescriptorEventW’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:448:16: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateFileDescriptorEventW(lpEventAttributes, bManualReset, bInitialState, FileDescriptor, mode)’
# 446| }
# 447|
# 448|-> return handle;
# 449| #else
# 450| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/event.c:448:16: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateFileDescriptorEventW(lpEventAttributes, bManualReset, bInitialState, (int)(long int)pObject, 1)’
# 446| }
# 447|
# 448|-> return handle;
# 449| #else
# 450| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/mutex.c: scope_hint: In function ‘CreateMutexW’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/mutex.c:130:20: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateMutexW(lpMutexAttributes, initial, lpName)’
# 128| {
# 129| name = ConvertWCharToUtf8Alloc(lpName, NULL);
# 130|-> if (!name)
# 131| return NULL;
# 132| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/mutex.c:135:9: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateMutexW(lpMutexAttributes, initial, lpName)’
# 133|
# 134| handle = CreateMutexA(lpMutexAttributes, bInitialOwner, name);
# 135|-> free(name);
# 136| return handle;
# 137| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/mutex.c:165:16: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateMutexA(lpMutexAttributes, bInitialOwner, name)’
# 163| }
# 164|
# 165|-> return handle;
# 166| }
# 167|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/mutex.c: scope_hint: In function ‘CreateMutexA’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/mutex.c:165:16: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateMutexA(lpMutexAttributes, initial, lpName)’
# 163| }
# 164|
# 165|-> return handle;
# 166| }
# 167|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/semaphore.c: scope_hint: In function ‘CreateSemaphoreW’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/synch/semaphore.c:136:12: warning[-Wanalyzer-malloc-leak]: leak of ‘CreateSemaphoreW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, 0)’
# 134| semaphore = (WINPR_SEMAPHORE*)calloc(1, sizeof(WINPR_SEMAPHORE));
# 135|
# 136|-> if (!semaphore)
# 137| return NULL;
# 138|
Error: GCC_ANALYZER_WARNING (CWE-762): [#def88]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/utils/collections/BufferPool.c: scope_hint: In function ‘BufferPool_Take’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/utils/collections/BufferPool.c:338:17: warning[-Wanalyzer-mismatching-deallocation]: ‘buffer’ should have been deallocated with ‘free’ but was deallocated with ‘winpr_aligned_free’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/utils/collections/BufferPool.c:22: included_from: Included from here.
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/include/winpr/crt.h:120:83: note: in definition of macro ‘MoveMemory’
# 336| out_error:
# 337| if (pool->alignment)
# 338|-> winpr_aligned_free(buffer);
# 339| else
# 340| free(buffer);
Error: COMPILER_WARNING (CWE-843): [#def89]
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/utils/image.c: scope_hint: In function ‘winpr_convert_to_jpeg’
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/utils/image.c:630:50: warning[-Wincompatible-pointer-types]: passing argument 2 of ‘jpeg_write_scanlines’ from incompatible pointer type
freerdp-3.5.1-build/FreeRDP-3.5.1/winpr/libwinpr/utils/image.c:38: included_from: Included from here.
/usr/include/jpeglib.h:1009:52: note: expected ‘JSAMPARRAY’ {aka ‘unsigned char **’} but argument is of type ‘const JSAMPLE **’ {aka ‘const unsigned char **’}
# 628| const JDIMENSION offset = x * stride;
# 629| const JSAMPLE* coffset = &cdata[offset];
# 630|-> if (jpeg_write_scanlines(&cinfo, &coffset, 1) != 1)
# 631| goto fail;
# 632| }
Scan Properties
analyzer-version-clang | 18.1.7 |
analyzer-version-cppcheck | 2.14.2 |
analyzer-version-gcc | 14.1.1 |
analyzer-version-gcc-analyzer | 14.1.1 |
analyzer-version-shellcheck | 0.10.0 |
diffbase-analyzer-version-clang | 18.1.7 |
diffbase-analyzer-version-cppcheck | 2.14.2 |
diffbase-analyzer-version-gcc | 14.1.1 |
diffbase-analyzer-version-gcc-analyzer | 14.1.1 |
diffbase-analyzer-version-shellcheck | 0.10.0 |
diffbase-enabled-plugins | clang, cppcheck, gcc, shellcheck |
diffbase-exit-code | 0 |
diffbase-host | ip-172-16-1-127.us-west-2.compute.internal |
diffbase-mock-config | fedora-41-x86_64 |
diffbase-project-name | freerdp-3.4.0-1.fc40 |
diffbase-store-results-to | /tmp/tmpn5iian98/freerdp-3.4.0-1.fc40.tar.xz |
diffbase-time-created | 2024-07-03 12:37:36 |
diffbase-time-finished | 2024-07-03 12:47:19 |
diffbase-tool | csmock |
diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpn5iian98/freerdp-3.4.0-1.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpn5iian98/freerdp-3.4.0-1.fc40.src.rpm' |
diffbase-tool-version | csmock-3.5.3-1.el9 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-127.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | freerdp-3.5.1-2.fc41 |
store-results-to | /tmp/tmp2lxny7nk/freerdp-3.5.1-2.fc41.tar.xz |
time-created | 2024-07-03 12:47:55 |
time-finished | 2024-07-03 12:57:19 |
title | Newly introduced defects |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp2lxny7nk/freerdp-3.5.1-2.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp2lxny7nk/freerdp-3.5.1-2.fc41.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |