Can C++ memory leaks negatively affect CPU usage?-Collection of common programming errors
Disposing of previously allocated memory fragments should be relatively faster than their allocation and (as long as memory leak means “memory lost due to missing deallocation call”) it shouldn’t really affect your speed, only overall memory usage.
Although if you allocate huge amounts of memory every second and don’t do proper deallocations, this could be the problem. I had the same issue when wrongly compiled gtkmm + librsvg leaked ~5 megabytes per second on screen redraw and that, of course, had some notable performance impact.
Of course, this doesn’t mean you shouldn’t eliminate your memory leaks if you know that they exist. Memory leaks could cause something more serious than performance troubles.