(overloaded operator new, new[], delete, and delete[], don'tcha know, and kept track of things).
Result: No memory leak.
There may be a memory leak in code outside of this function, or there may be a bug inside the string or string stream classes.
But that function is safe, as far as I can tell. (I did a float, double and int conversion).
(Arguably, for speed purposes, you could avoid doing a 'new' of the istringstream, and just put it on the stack as a local, but internally, it's probably doing 'new's itself).
|