WIP: grabs

This commit is contained in:
Enrico Weigelt, metux IT consult 2024-09-04 12:47:02 +02:00
parent 3cbc9eda07
commit cd26413e82

View File

@ -197,21 +197,21 @@ GrabPtr
AllocGrab(const GrabPtr src)
{
GrabPtr grab = calloc(1, sizeof(GrabRec));
if (!grab)
return NULL;
if (grab) {
grab->xi2mask = xi2mask_new();
if (!grab->xi2mask) {
free(grab);
grab = NULL;
}
else if (src && !CopyGrab(grab, src)) {
free(grab->xi2mask);
free(grab);
grab = NULL;
}
}
if (!(grab->xi2mask = xi2mask_new())
goto err;
if (src && !CopyGrab(grab, src))
goto err;
return grab;
err:
free(grab->xi2mask);
free(grab);
return NULL;
}
GrabPtr