h-enum-r-avoid-extra-hold-20061008

FIXES 40699

avoid orphaning an extra hold
This commit is contained in:
Derrick Brashear 2006-10-09 04:15:45 +00:00
parent 5ae8cf85e6
commit 747a8d8f41

View File

@ -1123,8 +1123,11 @@ h_Enumerate_r(int (*proc) (), struct host *enumstart, char *param)
held = (*proc) (host, held, param);
if (!H_ENUMERATE_ISSET_HELD(held))
h_Release_r(host); /* this might free up the host */
if (H_ENUMERATE_ISSET_BAIL(held))
if (H_ENUMERATE_ISSET_BAIL(held)) {
if (!H_ENUMERATE_ISSET_HELD(nheld))
h_Release_r(next); /* this might free up the host */
break;
}
}
} /*h_Enumerate_r */