aboutsummaryrefslogtreecommitdiffstats
path: root/epan/frame_data.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-03-15 18:04:50 +0000
committerEvan Huus <eapache@gmail.com>2013-03-15 18:04:50 +0000
commit32799db42c65f2aa0d9b30212a2bde20b9d96d41 (patch)
tree57eb7c019916f4fc52ce819fe0ada718ba5beed1 /epan/frame_data.c
parent574d1ceec3c1b9fae918888d18146ac11ca992e0 (diff)
Fix the leaking of packet comments, i.e. the rest of
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7530 The frame_data_cleanup function was ambiguous; it was being used for two different purposes, and did neither of them quite properly. Split it instead into frame_data_reset and frame_data_destroy, and call the correct one depending on why we were originally calling frame_data_cleanup. svn path=/trunk/; revision=48324
Diffstat (limited to 'epan/frame_data.c')
-rw-r--r--epan/frame_data.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/epan/frame_data.c b/epan/frame_data.c
index e89862448d..c7558d88aa 100644
--- a/epan/frame_data.c
+++ b/epan/frame_data.c
@@ -315,22 +315,39 @@ frame_data_set_after_dissect(frame_data *fdata,
}
void
-frame_data_cleanup(frame_data *fdata)
+frame_data_reset(frame_data *fdata)
+{
+ fdata->flags.visited = 0;
+
+ if (fdata->pfd) {
+ g_slist_free(fdata->pfd);
+ fdata->pfd = NULL;
+ }
+}
+
+void
+frame_data_destroy(frame_data *fdata)
{
if (fdata->pfd) {
g_slist_free(fdata->pfd);
fdata->pfd = NULL;
}
- /* XXX, frame_data_cleanup() is called when redissecting (rescan_packets()),
- * which might be triggered by lot of things, like: preferences change,
- * setting manual address resolve, etc.. (grep by redissect_packets)
- * fdata->opt_comment can be set by user, which we must not discard when redissecting.
- */
-#if 0
if (fdata->opt_comment) {
g_free(fdata->opt_comment);
fdata->opt_comment = NULL;
}
-#endif
}
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 2
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=2 tabstop=8 expandtab:
+ * :indentSize=2:tabSize=8:noTabs=true:
+ */