forked from github/server
coverity scan CID 22511: dereference null return value
This commit is contained in:
parent
178a740ecf
commit
4da658584c
|
@ -428,7 +428,7 @@ static void sink_ship(region * r, ship * sh, unit * saboteur)
|
||||||
else {
|
else {
|
||||||
for (d = 0; d != MAXDIRECTIONS; ++d) {
|
for (d = 0; d != MAXDIRECTIONS; ++d) {
|
||||||
region *rn = rconnect(r, d);
|
region *rn = rconnect(r, d);
|
||||||
if (!fval(rn->terrain, SEA_REGION) && !move_blocked(NULL, r, rn)) {
|
if (rn && !fval(rn->terrain, SEA_REGION) && !move_blocked(NULL, r, rn)) {
|
||||||
safety = rn;
|
safety = rn;
|
||||||
probability = OCEAN_SWIMMER_CHANCE;
|
probability = OCEAN_SWIMMER_CHANCE;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue