From 68e4ccca58ee42733083164d52fd635fecce4a35 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Tue, 20 May 2014 21:46:49 +0200 Subject: [PATCH] WMaker: removed check that is always true in wDefaultsInitDomain (Coverity #50243) As pointed by Coverity, the function 'wdefaultspathfordomain' cannot return a NULL path, so it is not necessary to check for it. (in the present case, it led Coverity to think it was possible to have the structure 'stbuf' uninitialised) Signed-off-by: Christophe CURIS --- src/defaults.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/defaults.c b/src/defaults.c index 436cb203..2f4626fe 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -889,7 +889,6 @@ WDDomain *wDefaultsInitDomain(const char *domain, Bool requireDictionary) WDDomain *db; struct stat stbuf; static int inited = 0; - const char *the_path; WMPropList *shared_dict = NULL; if (!inited) { @@ -900,15 +899,14 @@ WDDomain *wDefaultsInitDomain(const char *domain, Bool requireDictionary) db = wmalloc(sizeof(WDDomain)); db->domain_name = domain; db->path = wdefaultspathfordomain(domain); - the_path = db->path; - if (the_path && stat(the_path, &stbuf) >= 0) { - db->dictionary = WMReadPropListFromFile(the_path); + if (stat(db->path, &stbuf) >= 0) { + db->dictionary = WMReadPropListFromFile(db->path); if (db->dictionary) { if (requireDictionary && !WMIsPLDictionary(db->dictionary)) { WMReleasePropList(db->dictionary); db->dictionary = NULL; - wwarning(_("Domain %s (%s) of defaults database is corrupted!"), domain, the_path); + wwarning(_("Domain %s (%s) of defaults database is corrupted!"), domain, db->path); } db->timestamp = stbuf.st_mtime; } else {