remove unnecessary malloc