linux-dmabuf: Fix crash with no valid modifiers

We shouldn't free &modifier_invalid because it wasn't allocated
with malloc()

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Derek Foreman 2017-06-26 14:44:54 -05:00 committed by Daniel Stone
parent 12968e3756
commit cd052a6214
1 changed files with 2 additions and 1 deletions

View File

@ -509,7 +509,8 @@ bind_linux_dmabuf(struct wl_client *client,
modifier_hi,
modifier_lo);
}
free(modifiers);
if (modifiers != &modifier_invalid)
free(modifiers);
}
free(formats);
}