This commit is contained in:
Lana Steuck 2012-03-21 13:36:03 -07:00
commit 3332c6a1b6

View File

@ -541,6 +541,8 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo,
J2dRlsTraceLn1(J2D_TRACE_ERROR, J2dRlsTraceLn1(J2D_TRACE_ERROR,
"X11SD_SetupSharedSegment shmget has failed: %s", "X11SD_SetupSharedSegment shmget has failed: %s",
strerror(errno)); strerror(errno));
free((void *)shminfo);
XDestroyImage(img);
return NULL; return NULL;
} }
@ -550,6 +552,8 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo,
J2dRlsTraceLn1(J2D_TRACE_ERROR, J2dRlsTraceLn1(J2D_TRACE_ERROR,
"X11SD_SetupSharedSegment shmat has failed: %s", "X11SD_SetupSharedSegment shmat has failed: %s",
strerror(errno)); strerror(errno));
free((void *)shminfo);
XDestroyImage(img);
return NULL; return NULL;
} }
@ -570,6 +574,9 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo,
J2dRlsTraceLn1(J2D_TRACE_ERROR, J2dRlsTraceLn1(J2D_TRACE_ERROR,
"X11SD_SetupSharedSegment XShmAttach has failed: %s", "X11SD_SetupSharedSegment XShmAttach has failed: %s",
strerror(errno)); strerror(errno));
shmdt(shminfo->shmaddr);
free((void *)shminfo);
XDestroyImage(img);
return NULL; return NULL;
} }
@ -1345,13 +1352,10 @@ void X11SD_DisposeXImage(XImage * image) {
#ifdef MITSHM #ifdef MITSHM
if (image->obdata != NULL) { if (image->obdata != NULL) {
X11SD_DropSharedSegment((XShmSegmentInfo*)image->obdata); X11SD_DropSharedSegment((XShmSegmentInfo*)image->obdata);
} else { image->obdata = NULL;
free(image->data);
} }
#else
free(image->data);
#endif /* MITSHM */ #endif /* MITSHM */
XFree(image); XDestroyImage(image);
} }
} }