(__db_rdetach): Unmap the region if necessary.

This commit is contained in:
Ulrich Drepper 1999-09-05 23:30:54 +00:00
parent 4768722739
commit 79effba1aa

View File

@ -507,8 +507,18 @@ __db_rdetach(infop)
* If the region was removed when it was created, no further action
* is required.
*/
if (F_ISSET(infop, REGION_REMOVED))
if (F_ISSET(infop, REGION_REMOVED)) {
if (F_ISSET(infop, REGION_PRIVATE)
&& !F_ISSET(infop, REGION_MALLOC))
/*
* If it is private and not malloced, the
* region is still mapped in. We need to
* discard our mapping of the region.
*/
ret = __db_unmapregion(infop);
goto done;
}
/*
* If the region was created in memory returned by malloc, the only
* action required is freeing the memory.