src/glu/mesa: fix mem leak (bug 26559)
authorBrian Paul <brianp@vmware.com>
Sun, 14 Feb 2010 17:02:42 +0000 (10:02 -0700)
committerBrian Paul <brianp@vmware.com>
Sun, 14 Feb 2010 17:05:42 +0000 (10:05 -0700)
src/glu/mesa/mipmap.c

index d85ce9b9b0affed3d7b15bce0640f05042902c27..ad6b6e63a62e2daad0888ddea7f1b0342726a363 100644 (file)
@@ -287,7 +287,11 @@ gluScaleImage(GLenum format,
       }
       break;
    default:
-      return GLU_INVALID_ENUM;
+      {
+         free(tempin);
+         free(tempout);
+         return GLU_INVALID_ENUM;
+      }
    }
 
 
@@ -670,6 +674,7 @@ gluBuild1DMipmaps(GLenum target, GLint components,
         break;
       default:
         /* Not implemented */
+        free(texture);
         return GLU_ERROR;
       }
    }