summaryrefslogtreecommitdiff
path: root/capinfos.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2010-01-23 12:29:57 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2010-01-23 12:29:57 +0000
commit81771c67b7b8b6b7a4c0da0a146448b2e49141aa (patch)
tree2ed5d03bee9c86debbc64c50c2a6691a126cba99 /capinfos.c
parent3d84667a34107e1a38255b1983393783f009564c (diff)
downloadwireshark-81771c67b7b8b6b7a4c0da0a146448b2e49141aa.tar.gz
Avoid crash on invalid file name.
svn path=/trunk/; revision=31632
Diffstat (limited to 'capinfos.c')
-rw-r--r--capinfos.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/capinfos.c b/capinfos.c
index f3c0fdb5f4..9dded9bda5 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -880,8 +880,8 @@ main(int argc, char *argv[])
hash_to_str(gcry_md_read(hd, GCRY_MD_RMD160), HASH_SIZE_RMD160, file_rmd160);
hash_to_str(gcry_md_read(hd, GCRY_MD_MD5), HASH_SIZE_MD5, file_md5);
}
- fclose(fh);
- gcry_md_reset(hd);
+ if (fh) fclose(fh);
+ if (hd) gcry_md_reset(hd);
}
#endif /* HAVE_LIBGCRYPT */