seamendc: fix potential double-free
If we don't set `buff = NULL` after it's freed by this loop, a later iteration over the loop where e.g., `stat` fails will call `free(buff)` again. Bug: 206470603 Test: TreeHugger Change-Id: Ic19195adb7398fe2f8ab682ed451f24463872562
This commit is contained in:
parent
889d8aa9a7
commit
3f0bbd132d
1 changed files with 1 additions and 0 deletions
|
@ -123,6 +123,7 @@ static int read_cil_files(struct cil_db **db, char **paths,
|
|||
goto parse_err;
|
||||
}
|
||||
free(buff);
|
||||
buff = NULL;
|
||||
}
|
||||
|
||||
return SEPOL_OK;
|
||||
|
|
Loading…
Reference in a new issue