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) {
|
||||
xmlNodePtr month = nsetMonths->nodeTab[i];
|
||||
xmlChar *propValue = xmlGetProp(month, BAD_CAST "name");
|
||||
int j;
|
||||
|
||||
if (propValue) {
|
||||
if (newyear
|
||||
|
@ -451,14 +450,17 @@ static int parse_calendar(xmlDocPtr doc)
|
|||
monthnames[i] = _strdup(mkname("calendar", (const char *)propValue));
|
||||
xmlFree(propValue);
|
||||
}
|
||||
for (j = 0; j != seasons; ++j) {
|
||||
xmlNodePtr season = month->parent;
|
||||
if (season == nsetSeasons->nodeTab[j]) {
|
||||
month_season[i] = j;
|
||||
break;
|
||||
if (nsetSeasons) {
|
||||
int j;
|
||||
for (j = 0; j != seasons; ++j) {
|
||||
xmlNodePtr season = month->parent;
|
||||
if (season == nsetSeasons->nodeTab[j]) {
|
||||
month_season[i] = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert(j != seasons);
|
||||
}
|
||||
assert(j != seasons);
|
||||
storms[i] = xml_ivalue(nsetMonths->nodeTab[i], "storm", 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue