dialog: prevent double free in case of errors