From b34ad495397404db5aaf1ce8aa8355542304d5fd Mon Sep 17 00:00:00 2001 From: nijtmans Date: Wed, 14 Jan 2009 22:59:02 +0000 Subject: fix for aMSN compatibility [tcl-Bug 2507326] --- ChangeLog | 4 ++++ generic/tkImgPhoto.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4d4886b..4f9e4f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-01-14 Jan Nijtmans + + * generic/tkImgPhoto.c: fix for aMSN compatibility [tcl-Bug 2507326] + 2009-01-11 George Peter Staplin * generic/tkEvent.c: Backport a fix from 8.6 for a NULL pointer diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index c9acc4d..6d5bfec 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -17,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.76.2.1 2008/11/19 00:37:35 nijtmans Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.76.2.2 2009/01/14 22:59:02 nijtmans Exp $ */ #include "tkInt.h" @@ -478,6 +478,7 @@ PhotoFormatThreadExitProc( while (tsdPtr->formatList != NULL) { freePtr = tsdPtr->formatList; tsdPtr->formatList = tsdPtr->formatList->nextPtr; + ckfree((char *) freePtr->name); ckfree((char *) freePtr); } } @@ -543,6 +544,10 @@ Tk_CreatePhotoImageFormat( copyPtr->nextPtr = tsdPtr->oldFormatList; tsdPtr->oldFormatList = copyPtr; } else { + /* for compatibility with aMSN: make a copy of formatPtr->name */ + char *name = ckalloc(strlen(formatPtr->name) + 1); + strcpy(name, formatPtr->name); + copyPtr->name = name; copyPtr->nextPtr = tsdPtr->formatList; tsdPtr->formatList = copyPtr; } -- cgit v0.12