aboutsummaryrefslogtreecommitdiffstats
path: root/randpkt.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2006-04-26 17:31:56 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2006-04-26 17:31:56 +0000
commit1c57b51e9ea3968ce5c6931415d9c7a7eb292905 (patch)
treec274c531e70d73df78683b9de040f306c8dcdc30 /randpkt.c
parentdbbd8cd9a1974092a59be29557fc5680852191de (diff)
Check for NULL return value from wtap_dump_open().
Fixes coverity bug 159. svn path=/trunk/; revision=18005
Diffstat (limited to 'randpkt.c')
-rw-r--r--randpkt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/randpkt.c b/randpkt.c
index 965189b06b..650b9dadc7 100644
--- a/randpkt.c
+++ b/randpkt.c
@@ -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();