mem leak fix for riecoin by user otila on bitcointalk