Avoid possible resource leaks by boost::scoped_array

Change-Id: I0da7f9621d2770f49a554fb97591d9cac0bde9be