[mutter/wip/carlosg/coverity-fixes: 11/13] wayland: Plug leak in error condition




commit ccaa4c049bfc0e9957ae2afae21ce2e7c8f4fa93
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Oct 24 23:57:55 2021 +0200

    wayland: Plug leak in error condition
    
    If we fail to bind the X11 socket, free the lock file string.
    
    CID: #1505865
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2061>

 src/wayland/meta-xwayland.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 596c8209fe..ff5150d014 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -777,6 +777,7 @@ choose_xdisplay (MetaXWaylandManager     *manager,
             {
               g_prefix_error (&local_error, "Failed to bind X11 socket: ");
               g_propagate_error (error, g_steal_pointer (&local_error));
+              g_free (lock_file);
               return FALSE;
             }
 


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