Skip to content

[#9] regmatch^%ydbposix should free its memory rather than relying on the user to do it

Sam Habiel requested to merge shabiel/YDBPosix:posix9-free-in-regmatch into master

This issue was exposed when running Valgrind on Octo, which uses regmatch^%ydbposix. The following was found:

  1. M users do not expect to free memory. So the developers and reviewers never thought of needing to call regfree.
  2. regfree is pretty difficult to use, requiring knowledge of the internal mechanics of how regmatch constructs the subscripts for a variable.

This commit makes regmatch free its own memory.

Running valgrind with Octo reveals no memory leaks now after all the frees were backtracked from the Octo code base.

Merge request reports