|
|
@@ -2702,31 +2702,11 @@ buff_read_function (char *buffer, int *position, VariantType * X) |
|
|
|
{ |
|
|
|
/* STRING */ |
|
|
|
var_make (argn, StringTypeCode); |
|
|
|
/* CM-20211223 this is double allocating, squashing the |
|
|
|
pointer from the calloc() within var_make(). The RAM! It |
|
|
|
be leakin'! */ |
|
|
|
/*if ((argn->Value.String = |
|
|
|
(StringType *) calloc (1, sizeof (StringType))) == NULL) |
|
|
|
{ |
|
|
|
WARN_OUT_OF_MEMORY; |
|
|
|
return RESULT_ERROR; |
|
|
|
}*/ |
|
|
|
/* CM-20211223 plug RAM leak. var_make() allocs RAM. */ |
|
|
|
PARAM_LENGTH = T.Length; |
|
|
|
/* CM-20211223 either we keep the buffer instead of making a |
|
|
|
new one or we need to free it. See RELEASE_VARIANT below. |
|
|
|
I'm unremm'ing PARAM_BUFFER and leaving RELEASE_VARIANT |
|
|
|
disabled. */ |
|
|
|
/* CM-20211223 Fix the RAM leak. We keep the buffer instead |
|
|
|
of making a new one and copying it. This is faster. */ |
|
|
|
PARAM_BUFFER = T.Buffer; |
|
|
|
/*if ((PARAM_BUFFER = |
|
|
|
(char *) calloc (T.Length + 1 /* NulChar *//* , |
|
|
|
sizeof (char))) == NULL) |
|
|
|
{ |
|
|
|
WARN_OUT_OF_MEMORY; |
|
|
|
return RESULT_ERROR; |
|
|
|
} |
|
|
|
bwb_memcpy (PARAM_BUFFER, T.Buffer, T.Length); |
|
|
|
PARAM_BUFFER[PARAM_LENGTH] = NulChar;*/ |
|
|
|
/* add type to ParameterTypes */ |
|
|
|
if (ParameterCount < MAX_FARGS) |
|
|
|
{ |
|
|
|
ParameterTypes |= (1 << ParameterCount); |
|
|
@@ -2743,9 +2723,6 @@ buff_read_function (char *buffer, int *position, VariantType * X) |
|
|
|
{ |
|
|
|
ParameterCount++; |
|
|
|
} |
|
|
|
/* CM-20211223 see comment dated the same just above. I chose to |
|
|
|
keep the buffer... wondering why these had been rem'd out... */ |
|
|
|
/* RELEASE_VARIANT( &T ); */ |
|
|
|
} |
|
|
|
while (buff_skip_seperator (buffer, &p)); |
|
|
|
|
|
|
|