PIM-3556: Fix memory leak on versionning