Global variables are always initialized to zero/nil/false etc. Local variables are filled with random garbage, so you have to keep these "x := nil" initializations inside procedures, if you depend on them. This is true for both FPC and Delphi (but I don't know about Delphi .NET flavors).

That said, you don't have to check "if Assigned(x)" before calling FreeAndNil. FreeAndNil is guaranteed to do nothing if x is already nil. So you can remove these checks.