[PATCH] text-backend: check calloc results
U. Artie Eoff
ullysses.a.eoff at intel.com
Thu May 15 13:03:50 PDT 2014
Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
---
src/text-backend.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/text-backend.c b/src/text-backend.c
index d6a6f3b..362a3fa 100644
--- a/src/text-backend.c
+++ b/src/text-backend.c
@@ -358,6 +358,8 @@ static void text_input_manager_create_text_input(struct wl_client *client,
struct text_input *text_input;
text_input = calloc(1, sizeof *text_input);
+ if (text_input == NULL)
+ return;
text_input->resource =
wl_resource_create(client, &wl_text_input_interface, 1, id);
@@ -411,6 +413,9 @@ text_input_manager_create(struct weston_compositor *ec)
text_input_manager = calloc(1, sizeof *text_input_manager);
+ if (text_input_manager == NULL)
+ return;
+
text_input_manager->ec = ec;
text_input_manager->text_input_manager_global =
@@ -917,6 +922,9 @@ handle_seat_created(struct wl_listener *listener,
input_method = calloc(1, sizeof *input_method);
+ if (input_method == NULL)
+ return;
+
input_method->seat = seat;
input_method->model = NULL;
input_method->focus_listener_initialized = 0;
@@ -969,6 +977,9 @@ text_backend_init(struct weston_compositor *ec)
text_backend = calloc(1, sizeof(*text_backend));
+ if (text_backend == NULL)
+ return -1;
+
text_backend->compositor = ec;
text_backend->seat_created_listener.notify = handle_seat_created;
--
1.9.0
More information about the wayland-devel
mailing list