From b6bbfdcc5f1d90d00ccc0244e5e9792558d25abd Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 8 Mar 2014 17:27:33 -0800 Subject: [PATCH] Avoid calling free on uninitialized dive variable Signed-off-by: Dirk Hohndel --- libdivecomputer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdivecomputer.c b/libdivecomputer.c index f7fff8285..309605e56 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -392,7 +392,7 @@ static int dive_cb(const unsigned char *data, unsigned int size, device_data_t *devdata = userdata; dc_datetime_t dt = { 0 }; struct tm tm; - struct dive *dive; + struct dive *dive = NULL; /* reset the deco / ndl data */ ndl = stoptime = stopdepth = 0;