[PATCH 1/2] libsepol: do not use handle when it is marked unused

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Assigning NULL to handle does not perform anything useful and clang
complains about this:

    ibendports.c:122:2: error: 'handle' was marked unused but was used
    [-Werror,-Wused-but-marked-unused]
        handle = NULL;
        ^
    ibpkeys.c:115:2: error: 'handle' was marked unused but was used
    [-Werror,-Wused-but-marked-unused]
        handle = NULL;
        ^

Signed-off-by: Nicolas Iooss <nicolas.iooss@xxxxxxx>
---
 libsepol/src/ibendports.c | 1 -
 libsepol/src/ibpkeys.c    | 1 -
 2 files changed, 2 deletions(-)

diff --git a/libsepol/src/ibendports.c b/libsepol/src/ibendports.c
index 0438093e3053..6d56c9a1793f 100644
--- a/libsepol/src/ibendports.c
+++ b/libsepol/src/ibendports.c
@@ -119,7 +119,6 @@ extern int sepol_ibendport_count(sepol_handle_t *handle __attribute__ ((unused))
 
 	*response = count;
 
-	handle = NULL;
 	return STATUS_SUCCESS;
 }
 
diff --git a/libsepol/src/ibpkeys.c b/libsepol/src/ibpkeys.c
index ad6c07fe2c2d..682bf5db210c 100644
--- a/libsepol/src/ibpkeys.c
+++ b/libsepol/src/ibpkeys.c
@@ -112,7 +112,6 @@ extern int sepol_ibpkey_count(sepol_handle_t *handle __attribute__ ((unused)),
 
 	*response = count;
 
-	handle = NULL;
 	return STATUS_SUCCESS;
 }
 
-- 
2.12.2




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux