buffer: fix wlr_texture leak on failed alloc

master
emersion 7 years ago
parent da114d5013
commit 225aa815b0
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

@ -97,6 +97,7 @@ struct wlr_buffer *wlr_buffer_create(struct wlr_renderer *renderer,
struct wlr_buffer *buffer = calloc(1, sizeof(struct wlr_buffer));
if (buffer == NULL) {
wlr_texture_destroy(texture);
return NULL;
}
buffer->resource = resource;

Loading…
Cancel
Save