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