diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-02-25 05:21:08 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-02-25 05:21:08 +0000 |
commit | 983e4f9de31643e3d6b7829b26e8c69c68ec7dc2 (patch) | |
tree | e74a27a1aee45baaef9916897e066fe1bd7834ec /ringbuffer.c | |
parent | 9251b808b2ddbfabdcdfd99bcb5d5f4a8730b1df (diff) | |
download | wireshark-983e4f9de31643e3d6b7829b26e8c69c68ec7dc2.tar.gz |
Don't unlink ringbuffer files if we haven't yet allocated the array of
ringbuffer files - yes, we can fail before that's done, so we have to
check for that.
svn path=/trunk/; revision=10232
Diffstat (limited to 'ringbuffer.c')
-rw-r--r-- | ringbuffer.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ringbuffer.c b/ringbuffer.c index 90f8708f24..2584dde4b4 100644 --- a/ringbuffer.c +++ b/ringbuffer.c @@ -1,7 +1,7 @@ /* ringbuffer.c * Routines for packet capture windows * - * $Id: ringbuffer.c,v 1.7 2003/06/22 16:06:03 deniel Exp $ + * $Id: ringbuffer.c,v 1.8 2004/02/25 05:21:08 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -349,9 +349,11 @@ ringbuf_error_cleanup(void) rb_data.fd = -1; } - for (i=0; i < rb_data.num_files; i++) { - if (rb_data.files[i].name != NULL) { - unlink(rb_data.files[i].name); + if (rb_data.files != NULL) { + for (i=0; i < rb_data.num_files; i++) { + if (rb_data.files[i].name != NULL) { + unlink(rb_data.files[i].name); + } } } /* free the memory */ |