See ChangeLog entry 19990518-15:20 EDT David G. Holm <dholm@jsd-llc.com>

This commit is contained in:
David G. Holm
1999-05-18 20:21:57 +00:00
parent 00774e4ae6
commit b2e09396ed
2 changed files with 26 additions and 13 deletions

View File

@@ -1,3 +1,7 @@
19990518-15:20 EDT David G. Holm <dholm@jsd-llc.com>
* source/rtl/set.c
- Fixed memory leak in HB_SETCENTURY
19990518-03:05 Ryszard Glab <rglab@imid.med.pl>
* source/compiler/harbour.l

View File

@@ -99,13 +99,16 @@ HARBOUR HB_SETCENTURY (void)
else size += 2;
/* Create the new date format */
szNewFormat = (char*)_xgrab (size + 1);
if (y_start > 0) memcpy (szNewFormat, szDateFormat, y_start);
szNewFormat [y_start] = 0;
strcat (szNewFormat, "YY");
if (hb_set_century) strcat (szNewFormat, "YY");
strcat (szNewFormat, szDateFormat + y_stop);
_xfree (szDateFormat);
hb_set.HB_SET_DATEFORMAT = szNewFormat;
if (szNewFormat)
{
if (y_start > 0) memcpy (szNewFormat, szDateFormat, y_start);
szNewFormat [y_start] = 0;
strcat (szNewFormat, "YY");
if (hb_set_century) strcat (szNewFormat, "YY");
if (y_stop < strlen (szDateFormat)) strcat (szNewFormat, szDateFormat + y_stop);
_xfree (szDateFormat);
hb_set.HB_SET_DATEFORMAT = szNewFormat;
}
}
}
@@ -339,10 +342,16 @@ void InitializeSets (void)
void ReleaseSets (void)
{
_xfree (hb_set.HB_SET_COLOR);
_xfree (hb_set.HB_SET_DATEFORMAT);
_xfree (hb_set.HB_SET_DEFAULT);
_xfree (hb_set.HB_SET_DELIMCHARS);
_xfree (hb_set.HB_SET_DEVICE);
_xfree (hb_set.HB_SET_PATH);
if (hb_set.HB_SET_COLOR)
_xfree (hb_set.HB_SET_COLOR);
if (hb_set.HB_SET_DATEFORMAT)
_xfree (hb_set.HB_SET_DATEFORMAT);
if (hb_set.HB_SET_DEFAULT)
_xfree (hb_set.HB_SET_DEFAULT);
if (hb_set.HB_SET_DELIMCHARS)
_xfree (hb_set.HB_SET_DELIMCHARS);
if (hb_set.HB_SET_DEVICE)
_xfree (hb_set.HB_SET_DEVICE);
if (hb_set.HB_SET_PATH)
_xfree (hb_set.HB_SET_PATH);
}