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>
This commit is contained in:
parent
b469fc72d2
commit
dc2998bf06
|
@ -167,11 +167,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id)
|
||||||
&wl_output_interface, 2);
|
&wl_output_interface, 2);
|
||||||
wl_output_add_listener(xwl_output->output, &output_listener, xwl_output);
|
wl_output_add_listener(xwl_output->output, &output_listener, xwl_output);
|
||||||
|
|
||||||
if (snprintf(name, sizeof name, "XWAYLAND%d", serial++) < 0) {
|
snprintf(name, sizeof name, "XWAYLAND%d", serial++);
|
||||||
ErrorF("create_output ENOMEM\n");
|
|
||||||
free(xwl_output);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
xwl_output->xwl_screen = xwl_screen;
|
xwl_output->xwl_screen = xwl_screen;
|
||||||
xwl_output->randr_crtc = RRCrtcCreate(xwl_screen->screen, xwl_output);
|
xwl_output->randr_crtc = RRCrtcCreate(xwl_screen->screen, xwl_output);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user