struct clone *clone = add_clone(ctx);
RROutput id;
+ if (clone == NULL)
+ return -ENOMEM;
+
clone->depth = 24;
clone->next = display->clone;
display->clone = clone;
struct clone *clone = add_clone(ctx);
RROutput id;
+ if (clone == NULL)
+ return -ENOMEM;
+
if (xi[n].width == 0 || xi[n].height == 0)
continue;
static int last_display_add_clones__display(struct context *ctx)
{
struct display *display = last_display(ctx);
- struct clone *clone = add_clone(ctx);
Display *dpy = display->dpy;
+ struct clone *clone;
Screen *scr;
char buf[80];
int ret;
RROutput id;
- DBG(("%s(%s)\n", __func__, DisplayString(display->dpy)));
+
+ DBG(("%s(%s)\n", __func__, DisplayString(dpy)));
+ clone = add_clone(ctx);
+ if (clone == NULL)
+ return -ENOMEM;
clone->depth = 24;
clone->next = display->clone;
ret = clone_init_depth(clone);
if (ret) {
fprintf(stderr, "Failed to negotiate image format for display \"%s\"\n",
- DisplayString(display->dpy));
+ DisplayString(dpy));
return ret;
}
ret = clone_update_modes__fixed(clone);
if (ret) {
fprintf(stderr, "Failed to clone display \"%s\"\n",
- DisplayString(display->dpy));
+ DisplayString(dpy));
return ret;
}