sonar-openedge icon indicating copy to clipboard operation
sonar-openedge copied to clipboard

Dynamic object leak - TABLE-HANDLE/DATASET-HANDLE parameters

Open danielbecroft opened this issue 1 month ago • 1 comments

We're doing some analysis/testing on the sonar-openedge plugin across our 2m+ lines of application code before purchasing a license. Some of the scenarios for detecting memory leaks are working (some we didn't even know we had), but there are a couple that aren't being detected.

procedure Procedure_With_InputOutput private:

    define input-output parameter table-handle vPrivateTableHandle.

    // no delete object, this is a memory leak

end procedure.

In this scenario, vPrivateTableHandle needs to be deleted, as it will have been copied. It's not raising a violation for the "dynamic object leak" call.

Another scenario would be:

run Procedure_With_Output(output table-handle vTableHandle).

procedure Procedure_With_Output private:

    define output parameter table for ttFoo.

end procedure.

vTableHandle is an OUTPUT TABLE-HANDLE, so it's the callers responsibility to delete it.

I'm not sure how easy these are to implement, especially when incorporating BY-REFERENCE, REFERENCE-ONLY and BIND options.

danielbecroft avatar Dec 08 '25 06:12 danielbecroft

We will add this request to the backlog.

gquerret avatar Dec 09 '25 13:12 gquerret