summaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index fed448c9c..a990a4fc8 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -854,10 +854,12 @@ const char *do_libdivecomputer_import(device_data_t *data)
err = do_device_import(data);
/* TODO: Show the logfile to the user on error. */
dc_device_close(data->device);
+ data->device = NULL;
} else if (subsurface_access(data->devname, R_OK | W_OK) != 0)
err = translate("gettextFromC", "Insufficient privileges to open the device %s %s (%s)");
dc_context_free(data->context);
+ data->context = NULL;
if (fp) {
fclose(fp);