diff options
author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-09-20 18:18:29 +0000 |
---|---|---|
committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-09-20 18:18:29 +0000 |
commit | 2e282e75671cd256ad0acc302a1d8ddf7a1a17e7 (patch) | |
tree | 793291d9953a76b04f5265c5fa0ee8ba6c613601 /file.c | |
parent | 92a1cdd4a412ffc3f9b5703001eb981212258bc9 (diff) |
Introduce frame_data_cleanup() and start using it
svn path=/trunk/; revision=30023
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 23 |
1 files changed, 6 insertions, 17 deletions
@@ -1844,10 +1844,7 @@ rescan_packets_old(capture_file *cf, const char *action, const char *action_item * "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, @@ -1903,10 +1900,7 @@ rescan_packets_old(capture_file *cf, const char *action, const char *action_item 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); } } @@ -2148,11 +2142,9 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item, * 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. */ @@ -2214,10 +2206,7 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item, 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); } } |