diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2006-04-26 17:31:56 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2006-04-26 17:31:56 +0000 |
commit | 1c57b51e9ea3968ce5c6931415d9c7a7eb292905 (patch) | |
tree | c274c531e70d73df78683b9de040f306c8dcdc30 | |
parent | dbbd8cd9a1974092a59be29557fc5680852191de (diff) |
Check for NULL return value from wtap_dump_open().
Fixes coverity bug 159.
svn path=/trunk/; revision=18005
-rw-r--r-- | randpkt.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -483,6 +483,10 @@ main(int argc, char **argv) dump = wtap_dump_open(produce_filename, WTAP_FILE_PCAP, example->sample_wtap_encap, produce_max_bytes, FALSE /* compressed */, &err); + if (!dump) { + printf("Error writing to %s\n", produce_filename); + exit(1); + } seed(); |