[#2212] CID50183:

free base_ptr before function return
[#2212] CID50184:

null out varMap after free