forked from github/server
coverity scan CID 22553: dereference before null check
This commit is contained in:
parent
e60b739ea4
commit
70d4a6af03
1 changed files with 6 additions and 4 deletions
|
@ -929,12 +929,14 @@ static int parse_resources(xmlDocPtr doc)
|
||||||
flags |= RTF_LIMITED;
|
flags |= RTF_LIMITED;
|
||||||
|
|
||||||
name = xmlGetProp(node, BAD_CAST "name");
|
name = xmlGetProp(node, BAD_CAST "name");
|
||||||
assert(name != NULL);
|
if (!name) {
|
||||||
|
assert(name);
|
||||||
|
log_error("invalid resource %d has no name", i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
rtype = rt_get_or_create((const char *)name);
|
rtype = rt_get_or_create((const char *)name);
|
||||||
rtype->flags |= flags;
|
rtype->flags |= flags;
|
||||||
|
xmlFree(name);
|
||||||
if (name) xmlFree(name);
|
|
||||||
|
|
||||||
name = xmlGetProp(node, BAD_CAST "material");
|
name = xmlGetProp(node, BAD_CAST "material");
|
||||||
if (name) {
|
if (name) {
|
||||||
|
|
Loading…
Reference in a new issue