commit | 3f0bbd132d7464ad582d5708089ec3c34c73daf5 | [log] [tgz] |
---|---|---|
author | George Burgess IV <gbiv@google.com> | Tue Jul 12 10:05:11 2022 -0700 |
committer | George Burgess <gbiv@google.com> | Tue Jul 19 17:31:52 2022 +0000 |
tree | 79aaae8991dffa5f50bac7616c1bfbbd4e317ce9 | |
parent | 889d8aa9a7c494fb515a4730002624f233c4bd93 [diff] [blame] |
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
diff --git a/tools/seamendc.c b/tools/seamendc.c index 1328afb..2e49c1b 100644 --- a/tools/seamendc.c +++ b/tools/seamendc.c
@@ -123,6 +123,7 @@ goto parse_err; } free(buff); + buff = NULL; } return SEPOL_OK;