/* compare two frame_datas */
extern gint frame_data_compare(const frame_data *fdata1, const frame_data *fdata2, int field);
+extern void frame_data_cleanup(frame_data *fdata);
+
#endif /* __FRAME_DATA__ */
+
* "init_dissection()"), and null out the GSList pointer.
*/
fdata->flags.visited = 0;
- if (fdata->pfd) {
- g_slist_free(fdata->pfd);
- fdata->pfd = NULL;
- }
+ frame_data_cleanup(fdata);
}
if (!wtap_seek_read (cf->wth, fdata->file_off, &cf->pseudo_header,
until it finishes. Should we just stick them with that? */
for (; fdata != NULL; fdata = fdata->next) {
fdata->flags.visited = 0;
- if (fdata->pfd) {
- g_slist_free(fdata->pfd);
- fdata->pfd = NULL;
- }
+ frame_data_cleanup(fdata);
}
}
* data (the per-frame data itself was freed by
* "init_dissection()"), and null out the GSList pointer. */
fdata->flags.visited = 0;
- if (fdata->pfd) {
- g_slist_free(fdata->pfd);
- fdata->pfd = NULL;
- }
- /* cleanup_dissection() calls se_free_all();
+ frame_data_cleanup(fdata);
+
+ /* cleanup_dissection() calls se_free_all();
* And after that fdata->col_text (which is allocated using se_alloc0())
* no longer points to valid memory.
*/
until it finishes. Should we just stick them with that? */
for (; fdata != NULL; fdata = fdata->next) {
fdata->flags.visited = 0;
- if (fdata->pfd) {
- g_slist_free(fdata->pfd);
- fdata->pfd = NULL;
- }
+ frame_data_cleanup(fdata);
}
}
return err;
}
-/* Free up all data attached to a "frame_data" structure. */
-static void
-clear_fdata(frame_data *fdata)
-{
- if (fdata->pfd)
- g_slist_free(fdata->pfd);
-}
-
static gboolean
process_packet(capture_file *cf, gint64 offset, const struct wtap_pkthdr *whdr,
const guchar *pd)
}
epan_dissect_cleanup(&edt);
- clear_fdata(&fdata);
+ frame_data_cleanup(&fdata);
return passed;
}
return err;
}
-/* Free up all data attached to a "frame_data" structure. */
-static void
-clear_fdata(frame_data *fdata)
-{
- if (fdata->pfd)
- g_slist_free(fdata->pfd);
-}
-
static gboolean
process_packet(capture_file *cf, gint64 offset, const struct wtap_pkthdr *whdr,
union wtap_pseudo_header *pseudo_header, const guchar *pd,
if (do_dissection) {
epan_dissect_cleanup(&edt);
- clear_fdata(&fdata);
+ frame_data_cleanup(&fdata);
}
return passed;
}