Change dynamically allocated array to alloca