We're also not freeing the contents of the array. We're using the wrong function - see the docs I linked :)