Thanks for your report.
I have sent you an email with a debug version of WinSCP to address you have used to register on this forum.
Invalid access to memory
we have winscp 4.3.9 version that uses for sync. task for local folder with remote ftp server without any problem.
but while install new version 5.1.2 I got " invalid access to memory" after many times the sync. task running.
therefore I downgrade to 4.3.9 and my problem solved.
please let me know where is the problem.