mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Clear stale pointers after free
This is so that we can re-use the same device_data_t in other calls that doesn't allocate a context for example. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
221b5f0ff7
commit
8455b4b35c
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue