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,9 +1123,12 @@ h_Enumerate_r(int (*proc) (), struct host *enumstart, char *param)
held = (*proc) (host, held, param); held = (*proc) (host, held, param);
if (!H_ENUMERATE_ISSET_HELD(held)) if (!H_ENUMERATE_ISSET_HELD(held))
h_Release_r(host); /* this might free up the host */ 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; break;
} }
}
} /*h_Enumerate_r */ } /*h_Enumerate_r */
/* inserts a new HashChain structure corresponding to this UUID */ /* inserts a new HashChain structure corresponding to this UUID */