progs/tests: Fix memory leak in texdown.c if malloc fails.
authorVinson Lee <vlee@vmware.com>
Thu, 19 Nov 2009 01:30:50 +0000 (17:30 -0800)
committerVinson Lee <vlee@vmware.com>
Thu, 19 Nov 2009 01:30:50 +0000 (17:30 -0800)
progs/tests/texdown.c

index 7e46045832545f9fe43c7a08ddd334a0ad709bec..e6881d39a0a7ec4e59b0f478ca9b6beb2f27bd84 100644 (file)
@@ -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;
    }