fix mem leak on maskedCopy
Merge remote-tracking branch 'upstream/master'