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:
George Burgess IV 2022-07-12 10:05:11 -07:00 committed by George Burgess
parent 889d8aa9a7
commit 3f0bbd132d

View file

@ -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;