1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 22:28:02 +01:00

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 <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-20 21:46:49 +02:00
committed by Carlos R. Mafra
parent 788a51c116
commit 68e4ccca58

View File

@@ -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 {