CID 22549: Dereference before null check (REVERSE_INULL)

This commit is contained in:
Enno Rehling 2015-10-30 12:49:37 +01:00
parent e1eb5098d4
commit 1d204b12f1
1 changed files with 8 additions and 8 deletions

View File

@ -319,18 +319,18 @@ order * ord)
} }
a = a_find(u->attribs, &at_museumexit); a = a_find(u->attribs, &at_museumexit);
assert(a); if (a) {
r = findregion(a->data.sa[0], a->data.sa[1]); r = findregion(a->data.sa[0], a->data.sa[1]);
assert(r); assert(r);
a_remove(&u->attribs, a); a_remove(&u->attribs, a);
}
/* Übergebene Gegenstände zurückgeben */ /* Übergebene Gegenstände zurückgeben */
a = a_find(u->attribs, &at_museumgivebackcookie); a = a_find(u->attribs, &at_museumgivebackcookie);
unit_cookie = a->data.i;
a_remove(&u->attribs, a);
if (a) { if (a) {
unit_cookie = a->data.i;
a_remove(&u->attribs, a);
for (a = a_find(warden->attribs, &at_museumgiveback); for (a = a_find(warden->attribs, &at_museumgiveback);
a && a->type == &at_museumgiveback; a = a->next) { a && a->type == &at_museumgiveback; a = a->next) {
if (((museumgiveback *)(a->data.v))->cookie == unit_cookie) if (((museumgiveback *)(a->data.v))->cookie == unit_cookie)