Trying to fix SIGABRT on malloc