f0c487
Index: python-imaging-Pillow-d1c6db8/libImaging/Antialias.c
f0c487
===================================================================
f0c487
--- python-imaging-Pillow-d1c6db8.orig/libImaging/Antialias.c
f0c487
+++ python-imaging-Pillow-d1c6db8/libImaging/Antialias.c
f0c487
@@ -216,6 +216,7 @@ ImagingStretch(Imaging imOut, Imaging im
f0c487
                     break;
f0c487
                 default:
f0c487
                     ImagingSectionLeave(&cookie);
f0c487
+                    free(k);
f0c487
                     return (Imaging) ImagingError_ModeError();
f0c487
                 }
f0c487
         }
f0c487
@@ -295,6 +296,7 @@ ImagingStretch(Imaging imOut, Imaging im
f0c487
                     break;
f0c487
                 default:
f0c487
                     ImagingSectionLeave(&cookie);
f0c487
+                    free(k);
f0c487
                     return (Imaging) ImagingError_ModeError();
f0c487
                 }
f0c487
         }
f0c487
Index: python-imaging-Pillow-d1c6db8/libImaging/UnsharpMask.c
f0c487
===================================================================
f0c487
--- python-imaging-Pillow-d1c6db8.orig/libImaging/UnsharpMask.c
f0c487
+++ python-imaging-Pillow-d1c6db8/libImaging/UnsharpMask.c
f0c487
@@ -141,8 +141,10 @@ gblur(Imaging im, Imaging imOut, float f
f0c487
     /* don't bother about alpha/padding */
f0c487
     buffer = calloc((size_t) (im->xsize * im->ysize * channels),
f0c487
 		    sizeof(float));
f0c487
-    if (buffer == NULL)
f0c487
-	return ImagingError_MemoryError();
f0c487
+    if (buffer == NULL) {
f0c487
+        free(maskData);
f0c487
+        return ImagingError_MemoryError();
f0c487
+    }
f0c487
 
f0c487
     /* be nice to other threads while you go off to lala land */
f0c487
     ImagingSectionEnter(&cookie);