forked from github/server
coverity scan CID 22551: dereference before null check
This commit is contained in:
parent
4da658584c
commit
c7aa8c89b1
1 changed files with 5 additions and 3 deletions
|
@ -138,9 +138,11 @@ curse *shipcurse_flyingship(ship * sh, unit * mage, double power, int duration)
|
|||
/* mit C_SHIP_NODRIFT haben wir kein Problem */
|
||||
curse *c =
|
||||
create_curse(mage, &sh->attribs, ct_flyingship, power, duration, 0.0, 0);
|
||||
c->data.v = sh;
|
||||
if (c && c->duration > 0) {
|
||||
sh->flags |= SF_FLYING;
|
||||
if (c) {
|
||||
c->data.v = sh;
|
||||
if (c->duration > 0) {
|
||||
sh->flags |= SF_FLYING;
|
||||
}
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue