Fix potential uninitialized variable access

There are paths through this function that reach the comparison at the end
of it without trip_a and/or trip_b being initialized.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-01-25 15:55:18 -08:00
parent b696c61389
commit 27d51ce1d7

View file

@ -1472,7 +1472,7 @@ static gint dive_nr_sort(GtkTreeModel *model,
int idx_a, idx_b;
timestamp_t when_a, when_b;
struct dive *a, *b;
dive_trip_t *tripa,*tripb;
dive_trip_t *tripa = NULL, *tripb = NULL;
gtk_tree_model_get(model, iter_a, DIVE_INDEX, &idx_a, DIVE_DATE, &when_a, -1);
gtk_tree_model_get(model, iter_b, DIVE_INDEX, &idx_b, DIVE_DATE, &when_b, -1);