Fix: memory leak now freeing null_device and global source_password
Fix: memory leak, now also releasing reglist[] members
Fix: memory leak and race condition fix