The free's are called in the wrong order:
// mind the creation order:
AStrl := TStringList.Create;
AStrm := TMemoryStream.Create;
// and here you do the free in the wrong order
AStrl.Free;
AStrm.Free;
// which should be in the correct order
AStrm.Free;
AStrl.Free;
First create should be last free'd. IOW LIFO modeled, not FIFO
Since the stream has a dependency on the list that may cause your problem.
It may very well be that there is another bug elsewhere, but you should adhere to Last created should be first to free.
Your code contains a programmer error in the above code.
(By the way,) I would use two try finally's in the above code:
AStrl := TStringList.Create;
try
AStrm := TMemoryStream.Create;
try
.....
finally
Astrm.Free;
end;
finally
Astrl.free;
end;