From 55d1a4662d65b478b4bd398a4abfb7f102d52f0b Mon Sep 17 00:00:00 2001 From: Ondrej Kos Date: Fri, 7 Jun 2013 14:20:29 +0200 Subject: Don't test for NULL in nscd config check https://fedorahosted.org/sssd/ticket/1971 Coverity IDs: 11851, 11852, 11853 The NULL check on "entry" "service" and "enable" line string parts is not necessary and triggers warnings in coverity scans. --- src/util/nscd.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/util/nscd.c b/src/util/nscd.c index 2a06394d3..6c9cc7761 100644 --- a/src/util/nscd.c +++ b/src/util/nscd.c @@ -147,10 +147,6 @@ errno_t sss_nscd_parse_conf(const char *conf_path) while (getline(&line, &linelen, fp) != -1) { - entry = NULL; - service = NULL; - enabled = NULL; - pad = strchr(line, '#'); if (pad != NULL) { *pad = '\0'; @@ -191,15 +187,10 @@ errno_t sss_nscd_parse_conf(const char *conf_path) } *pad = '\0'; - if (entry != NULL && - service != NULL && - enabled != NULL) { - - if (!strcmp(entry, "enable-cache") && - !strcmp(enabled, "yes")) { + if (!strcmp(entry, "enable-cache") && + !strcmp(enabled, "yes")) { - occured |= sss_nscd_check_service(service); - } + occured |= sss_nscd_check_service(service); } }; -- cgit