diff mbox series

[36/47] libsemanage: drop dead code

Message ID 20241111141706.38039-36-cgoettsche@seltendoof.de (mailing list archive)
State New
Delegated to: Petr Lautrbach
Headers show
Series [01/47] libsemanage: white space cleanup | expand

Commit Message

Christian Göttsche Nov. 11, 2024, 2:16 p.m. UTC
From: Christian Göttsche <cgzones@googlemail.com>

The variable num_modules is already been dereferenced before the NULL
check, and also the code is identical for each condition outcome.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libsemanage/src/direct_api.c | 5 -----
 1 file changed, 5 deletions(-)
diff mbox series

Patch

diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c
index 3b2ab449..b10e5c8f 100644
--- a/libsemanage/src/direct_api.c
+++ b/libsemanage/src/direct_api.c
@@ -1958,11 +1958,6 @@  static int semanage_direct_list(semanage_handle_t * sh,
 		goto cleanup;
 	}
 
-	if (num_modules == 0) {
-		retval = semanage_direct_get_serial(sh);
-		goto cleanup;
-	}
-
 	retval = semanage_direct_get_serial(sh);
 
       cleanup: