mirror of
https://github.com/topjohnwu/selinux.git
synced 2025-02-12 23:08:51 +00:00
![Nicolas Iooss](/assets/img/avatar_default.png)
semanage_module_info_destroy() always returns 0. Nevertheless semanage_direct_list_all() uses its return value in a surprising way: cleanup: if (priorities != NULL) { /* ... */ free(priorities); } /* ... */ ret = semanage_module_info_destroy(sh, modinfo_tmp); if (ret != 0) { status = -1; goto cleanup; } The last "goto cleanup;" leads clang's static analyzer to believe a double free is possible. Even though this is a false positive, the body of condition "if (ret != 0)" contains dead code. Remove it. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>