Fix/version mem leak

| Q                    | A
| -------------------- | ---
| Bug fix?             | Yes
| New feature?         | No
| BC breaks?           | No
| CI currently passes? | Yes
| Tests pass?          | Yes
| Scenarios pass?      | Yes
| Checkstyle issues?*  | No
| PMD issues?**        | No
| Changelog updated?   | Yes
| Fixed tickets        | N.A.
| Doc PR               | N.A.