issue  #5791 : use new/delete [] instead of malloc/free for object array