mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 06:35:58 +01:00
Merge pull request #914 from emersion/misc-segfault-fixes
Misc segfault fixes
This commit is contained in:
commit
979b1b22d5
3 changed files with 3 additions and 2 deletions
|
@ -340,7 +340,7 @@ static void layer_shell_handle_get_layer_surface(struct wl_client *wl_client,
|
|||
surface->layer = layer;
|
||||
if (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) {
|
||||
free(surface);
|
||||
wl_resource_post_error(surface->resource,
|
||||
wl_resource_post_error(client_resource,
|
||||
ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER,
|
||||
"Invalid layer %d", layer);
|
||||
return;
|
||||
|
|
|
@ -399,7 +399,7 @@ static const struct xdg_positioner_interface
|
|||
static void xdg_shell_handle_create_positioner(struct wl_client *wl_client,
|
||||
struct wl_resource *resource, uint32_t id) {
|
||||
struct wlr_xdg_positioner *positioner =
|
||||
calloc(1, sizeof(struct wlr_xdg_positioner_resource));
|
||||
calloc(1, sizeof(struct wlr_xdg_positioner));
|
||||
if (positioner == NULL) {
|
||||
wl_client_post_no_memory(wl_client);
|
||||
return;
|
||||
|
|
|
@ -309,6 +309,7 @@ static bool source_get_targets(struct wlr_xwm_selection *selection,
|
|||
char **mime_type_ptr =
|
||||
wl_array_add(mime_types, sizeof(*mime_type_ptr));
|
||||
if (mime_type_ptr == NULL) {
|
||||
free(mime_type);
|
||||
break;
|
||||
}
|
||||
*mime_type_ptr = mime_type;
|
||||
|
|
Loading…
Reference in a new issue