X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/39236c6e673c41db228275375ab7fdb0f837b292..3e170ce000f1506b7b5d2c5c7faec85ceabb573d:/osfmk/vm/default_freezer.c diff --git a/osfmk/vm/default_freezer.c b/osfmk/vm/default_freezer.c index b7127b39e..d6601a227 100644 --- a/osfmk/vm/default_freezer.c +++ b/osfmk/vm/default_freezer.c @@ -845,9 +845,23 @@ default_freezer_handle_deallocate_locked( assert(df_handle); df_handle->dfh_ref_count--; if (df_handle->dfh_ref_count == 0) { + + if (df_handle->dfh_compact_object) { + vm_object_deallocate(df_handle->dfh_compact_object); + df_handle->dfh_compact_object = NULL; + df_handle->dfh_compact_offset = 0; + } + + if (df_handle->dfh_table) { + default_freezer_mapping_free(&df_handle->dfh_table, TRUE); + df_handle->dfh_table = NULL; + } + + lck_rw_done(&df_handle->dfh_lck); lck_rw_destroy(&df_handle->dfh_lck, &default_freezer_handle_lck_grp); - kfree(df_handle, sizeof(struct default_freezer_handle)); should_unlock = FALSE; + + kfree(df_handle, sizeof(struct default_freezer_handle)); } return should_unlock; }