mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
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
1 changed files with 3 additions and 1 deletions
|
|
@ -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 a new issue