diff --git a/ChangeLog b/ChangeLog index 9fa02b009..d9db43ba9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-06-16 13:36 Alexander Malmberg + + * Source/GSFormat.m (GSFormat()): Free malloc memory in all cases + after handling %s, %S, %@ with strings longer than 8192 characters. + 2003-06-15 Richard Frith-Macdonald * Source/NSAutoreleasePool.m: Documented. diff --git a/Source/GSFormat.m b/Source/GSFormat.m index 23915257e..1d1a4c371 100644 --- a/Source/GSFormat.m +++ b/Source/GSFormat.m @@ -1787,14 +1787,15 @@ NSDictionary *locale) if ((width -= len) <= 0) { outstring (string, len); - break; } - - if (!left) - PAD (' '); - outstring (string, len); - if (left) - PAD (' '); + else + { + if (!left) + PAD (' '); + outstring (string, len); + if (left) + PAD (' '); + } if (string_malloced) NSZoneFree(s->z, string); } @@ -1842,14 +1843,15 @@ NSDictionary *locale) if ((width -= len) < 0) { outstring (string, len); - break; } - - if (!left) - PAD (' '); - outstring (string, len); - if (left) - PAD (' '); + else + { + if (!left) + PAD (' '); + outstring (string, len); + if (left) + PAD (' '); + } if (string_malloced) NSZoneFree(s->z, string); }