summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXImage.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-07-19 20:35:32 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-07-19 20:35:32 (GMT)
commit111379aa313dcebc58385b6e7da71a3f49274f10 (patch)
tree1b953bc8c52b6e0d57685d4aa8ac2b6c21f2eedf /macosx/tkMacOSXImage.c
parentd5eda6f28707035093efe129d5788d0c1946cdd7 (diff)
downloadtk-111379aa313dcebc58385b6e7da71a3f49274f10.zip
tk-111379aa313dcebc58385b6e7da71a3f49274f10.tar.gz
tk-111379aa313dcebc58385b6e7da71a3f49274f10.tar.bz2
Fix [edb769628e]: Aqua: leak in XGetImage(). Patch from Christopher Chavez.
Diffstat (limited to 'macosx/tkMacOSXImage.c')
-rw-r--r--macosx/tkMacOSXImage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c
index 1d4238d..32f3db9 100644
--- a/macosx/tkMacOSXImage.c
+++ b/macosx/tkMacOSXImage.c
@@ -776,7 +776,6 @@ XGetImage(
bitmap_fmt = [bitmapRep bitmapFormat];
size = [bitmapRep bytesPerPlane];
bytes_per_row = [bitmapRep bytesPerRow];
- bitmap = (char *)ckalloc(size);
if ((bitmap_fmt != 0 && bitmap_fmt != NSAlphaFirstBitmapFormat)
|| [bitmapRep samplesPerPixel] != 4
|| [bitmapRep isPlanar] != 0
@@ -786,6 +785,7 @@ XGetImage(
[bitmapRep release];
return NULL;
}
+ bitmap = (char *)ckalloc(size);
memcpy(bitmap, (char *)[bitmapRep bitmapData], size);
[bitmapRep release];