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:
committed by
Carlos R. Mafra
parent
788a51c116
commit
68e4ccca58
@@ -889,7 +889,6 @@ WDDomain *wDefaultsInitDomain(const char *domain, Bool requireDictionary)
|
|||||||
WDDomain *db;
|
WDDomain *db;
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
static int inited = 0;
|
static int inited = 0;
|
||||||
const char *the_path;
|
|
||||||
WMPropList *shared_dict = NULL;
|
WMPropList *shared_dict = NULL;
|
||||||
|
|
||||||
if (!inited) {
|
if (!inited) {
|
||||||
@@ -900,15 +899,14 @@ WDDomain *wDefaultsInitDomain(const char *domain, Bool requireDictionary)
|
|||||||
db = wmalloc(sizeof(WDDomain));
|
db = wmalloc(sizeof(WDDomain));
|
||||||
db->domain_name = domain;
|
db->domain_name = domain;
|
||||||
db->path = wdefaultspathfordomain(domain);
|
db->path = wdefaultspathfordomain(domain);
|
||||||
the_path = db->path;
|
|
||||||
|
|
||||||
if (the_path && stat(the_path, &stbuf) >= 0) {
|
if (stat(db->path, &stbuf) >= 0) {
|
||||||
db->dictionary = WMReadPropListFromFile(the_path);
|
db->dictionary = WMReadPropListFromFile(db->path);
|
||||||
if (db->dictionary) {
|
if (db->dictionary) {
|
||||||
if (requireDictionary && !WMIsPLDictionary(db->dictionary)) {
|
if (requireDictionary && !WMIsPLDictionary(db->dictionary)) {
|
||||||
WMReleasePropList(db->dictionary);
|
WMReleasePropList(db->dictionary);
|
||||||
db->dictionary = NULL;
|
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;
|
db->timestamp = stbuf.st_mtime;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user