route6d(8): Fix potential double-free
In the case that the subsequent sysctl(3) call failed, 'buf' could be free(3)ed repeatedly. It isn't clear to me that that case is possible, but be clear and do the right thing in case it is. Reported by: Coverity CID: 272537 Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
fdaa5d1c07
commit
134fd583cb
@ -2598,8 +2598,10 @@ krtread(int again)
|
||||
sleep(1);
|
||||
retry++;
|
||||
errmsg = NULL;
|
||||
if (buf)
|
||||
if (buf) {
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) {
|
||||
errmsg = "sysctl estimate";
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user