aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-05-29 01:18:16 +0000
committerGuy Harris <guy@alum.mit.edu>2012-05-29 01:18:16 +0000
commit1660e397b9531c681a6747f8e37ee481630db33c (patch)
tree31b806ccaa0f31cb6d7007e1f99124cc1d076d7e /file.c
parent1020c20d9e94f3c0ddcf04a0e33cf2c4f1a66deb (diff)
Test was backwards - if fname_new is *NON*-null, it was the name of a
temporary file to which we were writing in order to do a "safe save". Thanks to Coverity for pointing this out - should fix CIDs 703317 and 703316. svn path=/trunk/; revision=42891
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/file.c b/file.c
index 85fae3b5b4..89b03937ff 100644
--- a/file.c
+++ b/file.c
@@ -4029,7 +4029,7 @@ cf_save_packets(capture_file *cf, const char *fname, guint save_format,
return CF_OK;
fail:
- if (fname_new == NULL) {
+ if (fname_new != NULL) {
/* We were trying to write to a temporary file; get rid of it if it
exists. (We don't care whether this fails, as, if it fails,
there's not much we can do about it. I guess if it failed for
@@ -4142,7 +4142,7 @@ cf_export_specified_packets(capture_file *cf, const char *fname,
return CF_OK;
fail:
- if (fname_new == NULL) {
+ if (fname_new != NULL) {
/* We were trying to write to a temporary file; get rid of it if it
exists. (We don't care whether this fails, as, if it fails,
there's not much we can do about it. I guess if it failed for