Fixed memory leak with string allocation.