Hi,
Are you getting an error in TestStand, such as 17004? You may want to have a look at the following article:
http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/d356aaf6898bdf7d8625683c006b4bdb?OpenDocument. Also, does this code work if you call it directly from a CVI app rather than calling it from TestStand? This error does necessarily not mean that there is a memory leak, but instead insufficient memory to perform a certain action. Maybe a small sample of code may help.
Also you may want to see a related post http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=506500000008000000E8140000&ECategory=TestStand. May provide some clues.