forked from github/server
coverity scan CID 22487: dereference after null check
we don't use many differnt calendars, so this has never happened.
This commit is contained in:
parent
e27c4b4164
commit
8b92003fff
1 changed files with 9 additions and 7 deletions
|
@ -439,7 +439,6 @@ static int parse_calendar(xmlDocPtr doc)
|
||||||
for (i = 0; i != nsetMonths->nodeNr; ++i) {
|
for (i = 0; i != nsetMonths->nodeNr; ++i) {
|
||||||
xmlNodePtr month = nsetMonths->nodeTab[i];
|
xmlNodePtr month = nsetMonths->nodeTab[i];
|
||||||
xmlChar *propValue = xmlGetProp(month, BAD_CAST "name");
|
xmlChar *propValue = xmlGetProp(month, BAD_CAST "name");
|
||||||
int j;
|
|
||||||
|
|
||||||
if (propValue) {
|
if (propValue) {
|
||||||
if (newyear
|
if (newyear
|
||||||
|
@ -451,6 +450,8 @@ static int parse_calendar(xmlDocPtr doc)
|
||||||
monthnames[i] = _strdup(mkname("calendar", (const char *)propValue));
|
monthnames[i] = _strdup(mkname("calendar", (const char *)propValue));
|
||||||
xmlFree(propValue);
|
xmlFree(propValue);
|
||||||
}
|
}
|
||||||
|
if (nsetSeasons) {
|
||||||
|
int j;
|
||||||
for (j = 0; j != seasons; ++j) {
|
for (j = 0; j != seasons; ++j) {
|
||||||
xmlNodePtr season = month->parent;
|
xmlNodePtr season = month->parent;
|
||||||
if (season == nsetSeasons->nodeTab[j]) {
|
if (season == nsetSeasons->nodeTab[j]) {
|
||||||
|
@ -459,6 +460,7 @@ static int parse_calendar(xmlDocPtr doc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(j != seasons);
|
assert(j != seasons);
|
||||||
|
}
|
||||||
storms[i] = xml_ivalue(nsetMonths->nodeTab[i], "storm", 0);
|
storms[i] = xml_ivalue(nsetMonths->nodeTab[i], "storm", 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue