[gnome-remote-desktop] session-rdp: Also free SAM database when setting its path fails



commit 21259bb514508ad9316e6e4588c274935396f225
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Tue Jul 19 13:53:30 2022 +0200

    session-rdp: Also free SAM database when setting its path fails
    
    Otherwise, the associated data is leaked.

 src/grd-session-rdp.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/grd-session-rdp.c b/src/grd-session-rdp.c
index d5626542..67d82693 100644
--- a/src/grd-session-rdp.c
+++ b/src/grd-session-rdp.c
@@ -2206,6 +2206,7 @@ init_rdp_session (GrdSessionRdp  *session_rdp,
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
                    "Failed to set path of SAM database");
+      g_clear_pointer (&session_rdp->sam_file, grd_rdp_sam_free_sam_file);
       freerdp_peer_context_free (peer);
       freerdp_peer_free (peer);
       return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]