Kbase P126403: Memory leak when passing a LONGCHAR as a function RETURN value
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/02/2009 |
|
Status: Unverified
SYMPTOM(s):
Memory leak when passing a LONGCHAR as a function RETURN value
A LONGCHAR passed back from a function causes a memory leak.
The LONGCHAR return value is not assigned to a variable. For example:
FUNCTION test RETURNS LONGCHAR ( plctext AS LONGCHAR ):
RETURN plctext .
END FUNCTION .
DEFINE VARIABLE ii AS INTEGER NO-UNDO.
DEFINE VARIABLE lctext AS LONGCHAR NO-UNDO.
lctext = FILL( "a", 30000 ) .
DO ii = 1 TO 1000 :
test( lctext ) . /* function call that doesn't assign return value */
END.
FACT(s) (Environment):
OpenEdge 10.1x
All Supported Operating Systems
CAUSE:
Bug# OE00159143
FIX:
Upgrade to OpenEdge 10.1C or later release
Workaround:
Assign the return value to a LONGCHAR variable to avoid the memory leak. For example:
DEFINE VARIABLE ii AS INTEGER NO-UNDO.
DEFINE VARIABLE lctext AS LONGCHAR NO-UNDO.
DEFINE VARIABLE octext AS LONGCHAR NO-UNDO.
lctext = FILL( "a", 30000 ) .
DO ii = 1 TO 1000 :
octext = test( lctext ) .
END.