From: Vinson Lee Date: Thu, 19 Nov 2009 01:30:50 +0000 (-0800) Subject: progs/tests: Fix memory leak in texdown.c if malloc fails. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=efb582fde7d1375b21ecb28d8ba5690181a02a93;p=mesa.git progs/tests: Fix memory leak in texdown.c if malloc fails. (cherry picked from commit e3cfd78969cd4a94fc83a5d6fb2f33730cc4e70f) --- diff --git a/progs/tests/texdown.c b/progs/tests/texdown.c index 7e460458325..e6881d39a0a 100644 --- a/progs/tests/texdown.c +++ b/progs/tests/texdown.c @@ -176,6 +176,8 @@ MeasureDownloadRate(void) orig_getImage = (GLubyte *) malloc(image_bytes + ALIGN); if (!orig_texImage || !orig_getImage) { DownloadRate = 0.0; + free(orig_texImage); + free(orig_getImage); return; }