aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/file_access.c
diff options
context:
space:
mode:
Diffstat (limited to 'wiretap/file_access.c')
-rw-r--r--wiretap/file_access.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index 4706035e77..c63f538c2f 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -365,10 +365,7 @@ wtap* wtap_open_offline(const char *filename, int *err, char **err_info,
Initialize the data offset while we're at it. */
if (file_seek(wth->fh, 0, SEEK_SET, err) == -1) {
/* I/O error - give up */
- if (wth->random_fh != NULL)
- file_close(wth->random_fh);
- file_close(wth->fh);
- g_free(wth);
+ wtap_close(wth);
return NULL;
}
@@ -376,10 +373,7 @@ wtap* wtap_open_offline(const char *filename, int *err, char **err_info,
case -1:
/* I/O error - give up */
- if (wth->random_fh != NULL)
- file_close(wth->random_fh);
- file_close(wth->fh);
- g_free(wth);
+ wtap_close(wth);
return NULL;
case 0: