Here I provide simple piece of code.
function GetStringList:TStringList; var i:integer; begin Result:=TStringList.Create; Result.Add(\'Adam\'); Res
It is the usage that is the leak, not the construct itself.
var sl2 : TStringlist; sl2:=GetStringList; sl.assign(sl2); sl2.free;
is perfectly fine, or easier even,
sl:=getstringlist; // no assign, thus no copy, one created one freed. sl.free;