cogland: Don't leak the shell surface struct if requested twice
If the shell surface is requested twice then Cogland will hit an error path but it would end up leaking the CoglandShellSurface struct it allocated. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit 622d41b04c2689a8e4fb6e1769aaf887a04242e8)
This commit is contained in:
parent
2f3591ace0
commit
efa3bd03c5
1 changed files with 2 additions and 1 deletions
|
@ -976,7 +976,7 @@ get_shell_surface (struct wl_client *client,
|
|||
struct wl_resource *surface_resource)
|
||||
{
|
||||
CoglandSurface *surface = surface_resource->data;
|
||||
CoglandShellSurface *shell_surface = g_new0 (CoglandShellSurface, 1);
|
||||
CoglandShellSurface *shell_surface;
|
||||
|
||||
if (surface->has_shell_surface)
|
||||
{
|
||||
|
@ -986,6 +986,7 @@ get_shell_surface (struct wl_client *client,
|
|||
return;
|
||||
}
|
||||
|
||||
shell_surface = g_new0 (CoglandShellSurface, 1);
|
||||
shell_surface->resource.destroy = destroy_shell_surface;
|
||||
shell_surface->resource.object.id = id;
|
||||
shell_surface->resource.object.interface = &wl_shell_surface_interface;
|
||||
|
|
Loading…
Add table
Reference in a new issue