Added regression for #3236

Failure to detect memory leak if pointer members are added. This test fails with very old cppcheck, just added new test