aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-26 17:37:27 +0200
committerGitHub <noreply@github.com>2018-04-26 17:37:27 +0200
commit979b1b22d598a8ff1d32903c96e049211f6a0285 (patch)
treeb86cf98ac2a7938c04da80f80d3be1363ae71ef6
parent93ebd33aa8458401cc70d6146556b67839882276 (diff)
parentc119c43b4838fc63273ac40ba7f29b412a62c2a4 (diff)
Merge pull request #914 from emersion/misc-segfault-fixes
Misc segfault fixes
-rw-r--r--types/wlr_layer_shell.c2
-rw-r--r--types/wlr_xdg_shell.c2
-rw-r--r--xwayland/selection/incoming.c1
3 files changed, 3 insertions, 2 deletions
diff --git a/types/wlr_layer_shell.c b/types/wlr_layer_shell.c
index 676ed06d..fd7bc659 100644
--- a/types/wlr_layer_shell.c
+++ b/types/wlr_layer_shell.c
@@ -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;
diff --git a/types/wlr_xdg_shell.c b/types/wlr_xdg_shell.c
index fce2a1bb..5fd3d33e 100644
--- a/types/wlr_xdg_shell.c
+++ b/types/wlr_xdg_shell.c
@@ -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;
diff --git a/xwayland/selection/incoming.c b/xwayland/selection/incoming.c
index 1b596254..5deb2286 100644
--- a/xwayland/selection/incoming.c
+++ b/xwayland/selection/incoming.c
@@ -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;