mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 08:26:27 +00:00
Fix minor memory management bug
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24853 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c4dbb7a39a
commit
235009b56b
3 changed files with 8 additions and 2 deletions
|
@ -1,6 +1,9 @@
|
|||
2007-03-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* NSTimeZones/NSTimeZones.tar: regenerated.
|
||||
* Source/GSString.m: getCString_c() Fix error freeing unallocated
|
||||
memory when converting a zero length constant string to external
|
||||
cstring representation.
|
||||
|
||||
2007-03-09 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
#include "config.h"
|
||||
#include <string.h>
|
||||
#include <Foundation/Foundation.h>
|
||||
#include "Foundation/Foundation.h"
|
||||
#include "GNUstepBase/GSCategories.h"
|
||||
#include "GNUstepBase/GSLock.h"
|
||||
#include "GSPrivate.h"
|
||||
|
|
|
@ -1624,7 +1624,10 @@ getCString_c(GSStr self, char *buffer, unsigned int maxLength,
|
|||
o._contents.c = self->_contents.c;
|
||||
GSStrWiden((GSStr)&o);
|
||||
getCString_u((GSStr)&o, buffer, maxLength, aRange, leftoverRange);
|
||||
NSZoneFree(o._zone, o._contents.u);
|
||||
if (o._flags.free == 1)
|
||||
{
|
||||
NSZoneFree(o._zone, o._contents.u);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue