gallium/u_transfer_helper: Free the staging buffer on unmap.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 7 Jun 2019 08:16:16 +0000 (01:16 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 9 Jun 2019 22:16:10 +0000 (15:16 -0700)
u_transfer_helper sometimes mallocs a staging buffer, and leaked it.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/gallium/auxiliary/util/u_transfer_helper.c

index 14c4d56392d041370be692ca98600122c2e2ece8..b7bd43fd97fa15ea7476ff84d043a5328fd209d6 100644 (file)
@@ -511,6 +511,7 @@ u_transfer_helper_transfer_unmap(struct pipe_context *pctx,
             helper->vtbl->transfer_unmap(pctx, trans->trans2);
       }
 
+      free(trans->staging);
       free(trans);
    } else {
       helper->vtbl->transfer_unmap(pctx, ptrans);