Another case of 'dereference before NULL check'

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-03-08 16:49:34 -08:00
parent 9ee0bfe633
commit 0b7c11a597

View file

@ -793,10 +793,12 @@ struct dive *merge_two_dives(struct dive *a, struct dive *b)
{ {
struct dive *res; struct dive *res;
int i, j; int i, j;
int id = a->id; int id;
if (!a || !b) if (!a || !b)
return NULL; return NULL;
id = a->id;
i = get_divenr(a); i = get_divenr(a);
j = get_divenr(b); j = get_divenr(b);
res = merge_dives(a, b, b->when - a->when, false); res = merge_dives(a, b, b->when - a->when, false);