aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-07-15 16:22:34 -0700
committerGuy Harris <guy@alum.mit.edu>2014-07-15 23:23:05 +0000
commit7344cfc78ff89603af6dec685ed968f5954e757d (patch)
tree2d2ff4223f44818b2bf3a628c5ce96cd0d091fd7 /wiretap
parent2c772e38256e22974e05eef01d59efe2120df5d5 (diff)
Have buffer_free() null out the buffer data pointer.
That prevents some double-free issues (I got one when doing non-"Update list of packets in real time" captures, if I do one such capture and then another one). Change-Id: Ia08034d9d1640bad21b74960efade8926dbfc5de Reviewed-on: https://code.wireshark.org/review/3063 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wiretap/buffer.c b/wiretap/buffer.c
index 27da08b4c8..e12c8de5f6 100644
--- a/wiretap/buffer.c
+++ b/wiretap/buffer.c
@@ -37,11 +37,12 @@ buffer_init(Buffer* buffer, gsize space)
buffer->first_free = 0;
}
-/* Frees the memory used by a buffer, and the buffer struct */
+/* Frees the memory used by a buffer */
void
buffer_free(Buffer* buffer)
{
g_free(buffer->data);
+ buffer->data = NULL;
}
/* Assures that there are 'space' bytes at the end of the used space