dont't use malloc on each line
add halt type
fix leak