CID 22509: Dereference null return value (NULL_RETURNS)

potential problems at the edge of the map.
This commit is contained in:
Enno Rehling 2015-10-30 12:57:07 +01:00
parent 8f7f182c91
commit e7ca5345d7
1 changed files with 5 additions and 3 deletions

View File

@ -117,9 +117,11 @@ void walk_connections(region *r, void(*cb)(connection *, void *), void *data) {
walk_i(r, borders[key], cb, data); walk_i(r, borders[key], cb, data);
for (d = 0; d != MAXDIRECTIONS; ++d) { for (d = 0; d != MAXDIRECTIONS; ++d) {
region *rn = r_connect(r, d); region *rn = r_connect(r, d);
int k = reg_hashkey(rn); if (rn) {
if (k < key) { int k = reg_hashkey(rn);
walk_i(r, borders[k], cb, data); if (k < key) {
walk_i(r, borders[k], cb, data);
}
} }
} }
} }