From 483c6da3a20b2064cd655f7cb19e6b98dee677ff Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Wed, 3 Mar 2021 18:50:45 -0500 Subject: [PATCH] libkvm: Refine the previous commit (645eaa2ccaed) Resort free()'ing memory in kvm_close() to make it easier to MFC. MFC after: 3 days --- lib/libkvm/kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index 2905302f32f2..b98f2f25e619 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -297,12 +297,12 @@ kvm_close(kvm_t *kd) free((void *) kd->argspc); if (kd->argv != 0) free((void *)kd->argv); + if (kd->dpcpu_initialized != 0) + free(kd->dpcpu_off); if (kd->pt_map != NULL) free(kd->pt_map); if (kd->page_map != NULL) free(kd->page_map); - if (kd->dpcpu_initialized != 0) - free(kd->dpcpu_off); if (kd->sparse_map != MAP_FAILED) munmap(kd->sparse_map, kd->pt_sparse_size); free((void *)kd);