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
This commit is contained in:
Guy Harris 2012-05-29 01:18:16 +00:00
parent 1020c20d9e
commit 1660e397b9
1 changed files with 2 additions and 2 deletions

4
file.c
View File

@ -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