Avoid possible resource leaks by boost::scoped_array

Change-Id: I3a9131d75690e18caec4c328934735a9ca19e7ca