renderer: fix potential leak

Found thanks to llvm scan-build.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent 2c6081225b
commit 8030fdbd92
  1. 5
      src/vrend_renderer.c

@ -6031,8 +6031,11 @@ void *vrend_renderer_get_cursor_contents(uint32_t res_handle, uint32_t *width, u
data = malloc(size);
data2 = malloc(size);
if (!data || !data2)
if (!data || !data2) {
free(data);
free(data2);
return NULL;
}
glBindTexture(res->target, res->id);
glGetnTexImageARB(res->target, 0, format, type, size, data);

Loading…
Cancel
Save