Fix malloc for dir string.