Avoid possible resource leaks by boost::scoped_array

Change-Id: Ie20fc857f19f74aaccb546f9bfa11a7a657d3e8a