diff --git a/src/ldso/pe_find_framework_loader.c b/src/ldso/pe_find_framework_loader.c index c138d32..10513c0 100644 --- a/src/ldso/pe_find_framework_loader.c +++ b/src/ldso/pe_find_framework_loader.c @@ -119,8 +119,12 @@ int32_t pe_find_framework_loader( OS_FILE_NON_DIRECTORY_FILE))) return status; + if (rtdata->hloader) + zw_close(hloader); + else + rtdata->hloader = hloader; + rtdata->hdsodir = hdsodir; - rtdata->hloader = hloader; rtdata->himage = himage; return OS_STATUS_SUCCESS; @@ -156,8 +160,12 @@ int32_t pe_find_framework_loader( OS_FILE_NON_DIRECTORY_FILE))) return status; + if (rtdata->hloader) + zw_close(hloader); + else + rtdata->hloader = hloader; + rtdata->hdsodir = 0; - rtdata->hloader = hloader; return OS_STATUS_SUCCESS; } @@ -261,8 +269,12 @@ int32_t pe_find_framework_loader( zw_close(hprevious); } + if (rtdata->hloader) + zw_close(hloader); + else + rtdata->hloader = hloader; + rtdata->hdsodir = 0; - rtdata->hloader = hloader; rtdata->himage = himage; rtdata->hroot = hparent;