summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDima Ryazanov <dima@gmail.com>2015-05-12 10:21:19 -0700
committerAdam Jackson <ajax@redhat.com>2015-09-24 13:10:46 -0400
commitdc2998bf060957b1fdd6bd2ea4f76c5154233a1b (patch)
tree7fde074bf69f167f067c926bb5ec8b80a521b3a7
parentb469fc72d2dd0cf60760fa0828ed73771c2a0512 (diff)
xwayland: Remove a useless out-of-memory check
snprintf does not allocate memory, so we can never get an out-of-memory error. (Also, the error handler would free xwl_output after it was already registered as an event listener.) Signed-off-by: Dima Ryazanov <dima@gmail.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
-rw-r--r--hw/xwayland/xwayland-output.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index 7e5484c7d..dd169e806 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -167,11 +167,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id)
&wl_output_interface, 2);
wl_output_add_listener(xwl_output->output, &output_listener, xwl_output);
- if (snprintf(name, sizeof name, "XWAYLAND%d", serial++) < 0) {
- ErrorF("create_output ENOMEM\n");
- free(xwl_output);
- return NULL;
- }
+ snprintf(name, sizeof name, "XWAYLAND%d", serial++);
xwl_output->xwl_screen = xwl_screen;
xwl_output->randr_crtc = RRCrtcCreate(xwl_screen->screen, xwl_output);