From efb582fde7d1375b21ecb28d8ba5690181a02a93 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 18 Nov 2009 17:30:50 -0800 Subject: [PATCH] progs/tests: Fix memory leak in texdown.c if malloc fails. (cherry picked from commit e3cfd78969cd4a94fc83a5d6fb2f33730cc4e70f) --- progs/tests/texdown.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.30.2