more raii and malloc kill