malloc error but compiles