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

View file

@ -117,11 +117,13 @@ 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);
if (rn) {
int k = reg_hashkey(rn); int k = reg_hashkey(rn);
if (k < key) { if (k < key) {
walk_i(r, borders[k], cb, data); walk_i(r, borders[k], cb, data);
} }
} }
}
} }
static connection **get_borders_i(const region * r1, const region * r2) static connection **get_borders_i(const region * r1, const region * r2)