platform_system_sepolicy/tools/fc_sort
Andreas Gampe c32d7bae15 fc_sort: Fix leaks
Use the getline API correctly: keep a single buffer as long as
possible, and let the callee handle re-allocation. Move the final
free out of the loop.

Release the head of the linked list.

Bug: 37757586
Test: ASAN_OPTIONS= SANITIZE_HOST=address mmma system/sepolicy
Change-Id: I42424acba7cd68c1b9a7a43e916a421ac3e253f7
2017-04-28 10:37:55 -07:00
..
Android.mk fc_sort: initial commit 2016-01-14 17:39:07 -08:00
fc_sort.c fc_sort: Fix leaks 2017-04-28 10:37:55 -07:00
MODULE_LICENSE_GPL fc_sort: initial commit 2016-01-14 17:39:07 -08:00
NOTICE fc_sort: add NOTICE file 2016-01-14 10:45:45 -08:00
README fc_sort: initial commit 2016-01-14 17:39:07 -08:00

fc_sort is a tool used for sorting the file_contexts entries based on a heuristic that is
 covered by a Fedora document. That document can be found here:
 * https://fedoraproject.org/wiki/SELinux/ManagingFileContext

The tool itself originates from:
 * https://github.com/TresysTechnology/refpolicy

It can be updated to the current tip of master branch with the below command:
$ wget https://raw.githubusercontent.com/TresysTechnology/refpolicy/master/support/fc_sort.c