Newly introduced defects

List of Defects

Error: CPPCHECK_WARNING: [#def1]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/redhat-linux-build/src/grd-dbus-gdm.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def2]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/redhat-linux-build/src/grd-dbus-remote-desktop.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-clipboard-rdp.c: scope_hint: In function ‘grd_clipboard_rdp_new’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-clipboard-rdp.c:2426:21: warning[-Wanalyzer-malloc-leak]: leak of ‘cliprdr_server_context_new(vcm)’
# 2424|   
# 2425|     clipboard_rdp = g_object_new (GRD_TYPE_CLIPBOARD_RDP, NULL);
# 2426|->   cliprdr_context = cliprdr_server_context_new (vcm);
# 2427|     if (!cliprdr_context)
# 2428|       {

Error: CLANG_WARNING: [#def4]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-credentials-one-time.c:192:66: warning[core.NullDereference]: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error')
#  190|     if (!credentials_one_time->rdp.username)
#  191|       {
#  192|->       g_warning ("Failed to generate one time RDP username: %s", error->message);
#  193|         return NULL;
#  194|       }

Error: CPPCHECK_WARNING: [#def5]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-daemon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-daemon.c: scope_hint: In function ‘on_handle_import_certificate’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-daemon.c:384:21: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_new_from_file(certificate_filename)’
#  382|       }
#  383|   
#  384|->   rdp_certificate = freerdp_certificate_new_from_file (certificate_filename);
#  385|     if (!rdp_certificate)
#  386|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-daemon.c:403:21: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_key_new_from_file(key_filename)’
#  401|       }
#  402|   
#  403|->   rdp_private_key = freerdp_key_new_from_file (key_filename);
#  404|     if (!rdp_private_key)
#  405|       {

Error: CPPCHECK_WARNING (CWE-664): [#def8]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-daemon.c:1223: error[va_end_missing]: va_list 'booleans' was opened but not closed by va_end().
# 1221|       booleans_count += va_arg (booleans, gboolean) ? 1 : 0;
# 1222|   
# 1223|->   return booleans_count;
# 1224|   }
# 1225|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def9]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-daemon.c: scope_hint: In function ‘count_trues’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-daemon.c:1224:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
# 1222|   
# 1223|     return booleans_count;
# 1224|-> }
# 1225|   
# 1226|   int

Error: CPPCHECK_WARNING: [#def10]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-enable-service.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def11]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-input.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def12]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-input.c:155:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#  153|       return;
#  154|   
#  155|->   locker = g_mutex_locker_new (&audio_input->prevent_dvc_init_mutex);
#  156|     if (audio_input->prevent_dvc_initialization)
#  157|       return;

Error: CLANG_WARNING: [#def13]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-input.c:578:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'audio_data'
#  576|       }
#  577|     if (!success || audio_data->n_frames == 0)
#  578|->     return CHANNEL_RC_OK;
#  579|   
#  580|     g_mutex_lock (&audio_input->pending_frames_mutex);

Error: CPPCHECK_WARNING (CWE-190): [#def14]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-input.c:696: error[integerOverflow]: Signed integer overflow for expression '0-1'.
#  694|       }
#  695|   
#  696|->   pw_core_add_listener (audio_input->pipewire_core,
#  697|                           &audio_input->pipewire_core_listener,
#  698|                           &pipewire_core_events, audio_input);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c: scope_hint: In function ‘grd_rdp_audio_playback_new’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c:765:20: warning[-Wanalyzer-malloc-leak]: leak of ‘rdpsnd_server_context_new(vcm)’
#  763|   
#  764|     audio_playback = g_object_new (GRD_TYPE_RDP_AUDIO_PLAYBACK, NULL);
#  765|->   rdpsnd_context = rdpsnd_server_context_new (vcm);
#  766|     if (!rdpsnd_context)
#  767|       g_error ("[RDP.AUDIO_PLAYBACK] Failed to create server context");

Error: GCC_ANALYZER_WARNING (CWE-688): [#def16]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c: scope_hint: In function ‘registry_event_global’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c:1270:11: warning[-Wanalyzer-null-argument]: use of NULL ‘*item.value’ where non-null expected
/usr/include/spa-0.2/spa/support/plugin.h:13: included_from: Included from here.
/usr/include/pipewire-0.3/pipewire/pipewire.h:12: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-pipewire-utils.h:24: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c:24: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c:1262:3: note: in expansion of macro ‘spa_dict_for_each’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c:1262:3: note: in expansion of macro ‘spa_dict_for_each’
/usr/include/glib-2.0/glib/glist.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/ghash.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:52: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.h:24: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c:22: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c:1266:11: note: in expansion of macro ‘g_clear_pointer’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c:1266:11: note: in expansion of macro ‘g_clear_pointer’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
/usr/include/glib-2.0/glib/gstrfuncs.h:324:38: note: in definition of macro ‘g_strdup’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c:1267:23: note: in expansion of macro ‘g_strdup’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.c: scope_hint: In function ‘registry_event_global’
/usr/include/winpr3/winpr/handle.h:25: included_from: Included from here.
/usr/include/winpr3/winpr/io.h:25: included_from: Included from here.
/usr/include/winpr3/winpr/file.h:28: included_from: Included from here.
/usr/include/winpr3/winpr/wtsapi.h:28: included_from: Included from here.
/usr/include/freerdp3/freerdp/types.h:25: included_from: Included from here.
/usr/include/freerdp3/freerdp/channels/wtsvc.h:35: included_from: Included from here.
/usr/include/freerdp3/freerdp/server/rdpsnd.h:25: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-audio-playback.h:23: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
# 1268|           }
# 1269|         if (strcmp (item->key, "media.class") == 0 &&
# 1270|->           strcmp (item->value, "Audio/Sink") == 0)
# 1271|           found_audio_sink = TRUE;
# 1272|       }

Error: CPPCHECK_WARNING: [#def17]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-connect-time-autodetection.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def18]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-connect-time-autodetection.c:86:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#   84|     g_autoptr (GMutexLocker) locker = NULL;
#   85|   
#   86|->   locker = g_mutex_locker_new (&ct_autodetection->ct_autodetection_mutex);
#   87|     return ct_autodetection->state == CT_AUTODETECT_STATE_COMPLETE;
#   88|   }

Error: CLANG_WARNING: [#def19]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-connect-time-autodetection.c:403:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#  401|     int64_t response_latency_us;
#  402|   
#  403|->   locker = g_mutex_locker_new (&ct_autodetection->ct_autodetection_mutex);
#  404|     switch (ct_autodetection->state)
#  405|       {

Error: CLANG_WARNING: [#def20]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-connect-time-autodetection.c:449:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#  447|     g_autoptr (GMutexLocker) locker = NULL;
#  448|   
#  449|->   locker = g_mutex_locker_new (&ct_autodetection->ct_autodetection_mutex);
#  450|     if (ct_autodetection->pending_last_sequence_number ||
#  451|         ct_autodetection->last_sequence_number != sequence_number)

Error: CPPCHECK_WARNING: [#def21]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-cursor-renderer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def22]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-renderer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def23]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-renderer.c:92:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#   90|     GHashTableIter iter;
#   91|   
#   92|->   locker = g_mutex_locker_new (&renderer->surface_renderers_mutex);
#   93|     g_hash_table_iter_init (&iter, renderer->surface_renderer_table);
#   94|     while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &surface_renderer))

Error: CLANG_WARNING: [#def24]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-renderer.c:365:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#  363|     g_autoptr (GMutexLocker) locker = NULL;
#  364|   
#  365|->   locker = g_mutex_locker_new (&renderer->inhibition_mutex);
#  366|     if (renderer->stop_rendering ||
#  367|         renderer->rendering_inhibited ||

Error: CLANG_WARNING: [#def25]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-renderer.c:469:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#  467|     g_autoptr (GMutexLocker) locker = NULL;
#  468|   
#  469|->   locker = g_mutex_locker_new (&renderer->inhibition_mutex);
#  470|     if (!g_hash_table_lookup_extended (renderer->render_context_table,
#  471|                                        rdp_surface,

Error: CPPCHECK_WARNING: [#def26]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c: scope_hint: In function ‘peek_routing_token’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c:194:7: warning[-Wanalyzer-malloc-leak]: leak of ‘Stream_New(0, 4)’
#  192|   
#  193|     /* Peek TPKT Header */
#  194|->   s = Stream_New (NULL, 4);
#  195|     g_assert (s);
#  196|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c:213:7: warning[-Wanalyzer-malloc-leak]: leak of ‘Stream_New(0, (long unsigned int)stream_read_u16_be(Stream_New(0, 4), 1))’
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.h:26: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c:25: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c:195:3: note: in expansion of macro ‘g_assert’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c: scope_hint: In function ‘peek_routing_token’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c:200:3: note: in expansion of macro ‘Stream_Read_UINT8’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c:200:3: note: in expansion of macro ‘Stream_Read_UINT8’
/usr/include/winpr3/winpr/assert.h:56: included_from: Included from here.
/usr/include/winpr3/winpr/stream.h:30: included_from: Included from here.
/usr/include/winpr3/winpr/stream.h:147:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:148:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
/usr/include/winpr3/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c:200:3: note: in expansion of macro ‘Stream_Read_UINT8’
/usr/include/winpr3/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c:202:3: note: in expansion of macro ‘Stream_Read_UINT16_BE’
/usr/include/winpr3/winpr/stream.h:181:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:182:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:182:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:62:39: note: in definition of macro ‘WINPR_STREAM_CAST’
/usr/include/winpr3/winpr/stream.h:127:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
/usr/include/winpr3/winpr/stream.h:128:17: note: in expansion of macro ‘WINPR_ASSERT’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-routing-token.c:202:3: note: in expansion of macro ‘Stream_Read_UINT16_BE’
#  211|     /* Peek full PDU */
#  212|     Stream_Free (s, TRUE);
#  213|->   s = Stream_New (NULL, tpkt_length);
#  214|     g_assert (s);
#  215|   

Error: CLANG_WARNING: [#def29]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-session-metrics.c:93:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#   91|     g_assert (session_metrics->phase == GRD_RDP_PHASE_SESSION_STARTED);
#   92|   
#   93|->   locker = g_mutex_locker_new (&session_metrics->metrics_mutex);
#   94|     if (session_metrics->pending_layout_change)
#   95|       return;

Error: CLANG_WARNING: [#def30]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-session-metrics.c:172:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#  170|     g_assert (session_metrics->phase == GRD_RDP_PHASE_SESSION_STARTED);
#  171|   
#  172|->   locker = g_mutex_locker_new (&session_metrics->metrics_mutex);
#  173|     g_assert (!session_metrics->pending_layout_change);
#  174|   

Error: CLANG_WARNING: [#def31]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-session-metrics.c:208:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#  206|     g_assert (session_metrics->phase == GRD_RDP_PHASE_SESSION_STARTED);
#  207|   
#  208|->   locker = g_mutex_locker_new (&session_metrics->metrics_mutex);
#  209|     session_metrics->layout_change_notification = g_get_monotonic_time ();
#  210|     session_metrics->pending_layout_change = TRUE;

Error: CLANG_WARNING: [#def32]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-session-metrics.c:222:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#  220|     g_assert (session_metrics->phase == GRD_RDP_PHASE_SESSION_STARTED);
#  221|   
#  222|->   locker = g_mutex_locker_new (&session_metrics->metrics_mutex);
#  223|     g_hash_table_remove_all (session_metrics->surface_metrics_table);
#  224|     session_metrics->n_pending_surface_metrics = 0;

Error: CLANG_WARNING: [#def33]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-rdp-surface-renderer.c:110:3: warning[deadcode.DeadStores]: Value stored to 'locker' is never read
#  108|     g_autoptr (GMutexLocker) locker = NULL;
#  109|   
#  110|->   locker = g_mutex_locker_new (&surface_renderer->render_mutex);
#  111|     if (!rdp_surface->pending_framebuffer)
#  112|       return G_SOURCE_CONTINUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c: scope_hint: In function ‘get_certificate_container’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:336:21: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_new_from_pem(certificate)’
#  334|     *size = 0;
#  335|   
#  336|->   rdp_certificate = freerdp_certificate_new_from_pem (certificate);
#  337|     if (!rdp_certificate)
#  338|       return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:345:7: warning[-Wanalyzer-malloc-leak]: leak of ‘Stream_New(0, 2048)’
#  343|       return NULL;
#  344|   
#  345|->   s = Stream_New (NULL, 2048);
#  346|     g_assert (s);
#  347|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c: scope_hint: In function ‘grd_session_rdp_send_server_redirection’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:392:17: warning[-Wanalyzer-malloc-leak]: leak of ‘redirection_new()’
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
/usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
/usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
/usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.h:23: included_from: Included from here.
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:22: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:387:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:388:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:388:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:389:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:389:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:390:3: note: in expansion of macro ‘g_assert’
/usr/include/glib-2.0/glib/gmacros.h:1243:31: note: in expansion of macro ‘_G_BOOLEAN_EXPR_IMPL’
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
/usr/include/glib-2.0/glib/gtestutils.h:276:49: note: in expansion of macro ‘G_LIKELY’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:390:3: note: in expansion of macro ‘g_assert’
#  390|     g_assert (certificate);
#  391|   
#  392|->   redirection = redirection_new ();
#  393|     g_assert (redirection);
#  394|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c: scope_hint: In function ‘init_rdp_session’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:1882:10: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_peer_new(g_socket_get_fd(g_socket_connection_get_socket(*session_rdp.connection)))’
# 1880|     g_debug ("Initialize RDP session");
# 1881|   
# 1882|->   peer = freerdp_peer_new (g_socket_get_fd (socket));
# 1883|     if (!peer)
# 1884|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:1927:21: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_new_from_pem(server_cert)’
# 1925|                   NULL);
# 1926|   
# 1927|->   rdp_certificate = freerdp_certificate_new_from_pem (server_cert);
# 1928|     if (!rdp_certificate)
# 1929|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:1934:8: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_new_from_pem(server_cert)’
# 1932|         return FALSE;
# 1933|       }
# 1934|->   if (!freerdp_settings_set_pointer_len (rdp_settings,
# 1935|                                            FreeRDP_RdpServerCertificate,
# 1936|                                            rdp_certificate, 1))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:1939:21: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_key_new_from_pem(server_key)’
# 1937|       g_assert_not_reached ();
# 1938|   
# 1939|->   rdp_private_key = freerdp_key_new_from_pem (server_key);
# 1940|     if (!rdp_private_key)
# 1941|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-session-rdp.c:1946:8: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_key_new_from_pem(server_key)’
# 1944|         return FALSE;
# 1945|       }
# 1946|->   if (!freerdp_settings_set_pointer_len (rdp_settings,
# 1947|                                            FreeRDP_RdpServerRsaKey,
# 1948|                                            rdp_private_key, 1))

Error: CPPCHECK_WARNING: [#def42]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-settings-system.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def43]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-settings-system.c:102:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'source'
#  100|                                      &error))
#  101|       {
#  102|->       g_debug ("Failed to load key file from '%s': %s",
#  103|                  file_path, error->message);
#  104|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-settings.c: scope_hint: In function ‘update_rdp_server_fingerprint’
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-settings.c:451:21: warning[-Wanalyzer-malloc-leak]: leak of ‘freerdp_certificate_new_from_file(*(GrdSettingsPrivate *)<unknown>.rdp.server_cert_path)’
#  449|   
#  450|   #ifdef HAVE_RDP
#  451|->   rdp_certificate = freerdp_certificate_new_from_file (priv->rdp.server_cert_path);
#  452|     if (!rdp_certificate)
#  453|       {

Error: CPPCHECK_WARNING: [#def45]
gnome-remote-desktop-46.2-build/gnome-remote-desktop-46.2/src/grd-utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-37.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-namegnome-remote-desktop-45.1-4.fc40
diffbase-store-results-to/tmp/tmpmzayb5p9/gnome-remote-desktop-45.1-4.fc40.tar.xz
diffbase-time-created2024-07-03 13:02:38
diffbase-time-finished2024-07-03 13:04:53
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpmzayb5p9/gnome-remote-desktop-45.1-4.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpmzayb5p9/gnome-remote-desktop-45.1-4.fc40.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-37.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namegnome-remote-desktop-46.2-1.fc41
store-results-to/tmp/tmpfsp5z0m_/gnome-remote-desktop-46.2-1.fc41.tar.xz
time-created2024-07-03 13:05:21
time-finished2024-07-03 13:07:34
titleNewly introduced defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpfsp5z0m_/gnome-remote-desktop-46.2-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpfsp5z0m_/gnome-remote-desktop-46.2-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9