aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
diff options
context:
space:
mode:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2009-06-02 17:22:40 +0000
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2009-06-02 17:22:40 +0000
commit7ac9b87db2cda197c607afbfae88f7417fba4767 (patch)
tree94fbc310e8a4d2d9b7aef47c2fef735d5db0bdb1 /editcap.c
parentea14ade104869bdc8ab6528471abb5113ee1fdb0 (diff)
Only call wtap_dump_close() if we have an open file.
We can have a situation where a file only contains a valid file header without any packages, so this will avoid a crash. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28602 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'editcap.c')
-rw-r--r--editcap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/editcap.c b/editcap.c
index d5ad41f97a..48d6f82004 100644
--- a/editcap.c
+++ b/editcap.c
@@ -1250,9 +1250,9 @@ main(int argc, char *argv[])
}
}
- if (!wtap_dump_close(pdh, &err)) {
+ if (pdh && !wtap_dump_close(pdh, &err)) {
- fprintf(stderr, "editcap: Error writing to %s: %s\n", filename,
+ fprintf(stderr, "editcap: Error closing %s: %s\n", filename,
wtap_strerror(err));
exit(2);