aboutsummaryrefslogtreecommitdiffstats
path: root/ui/tap-rlc-graph.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-04-05 00:23:35 -0700
committerGuy Harris <guy@alum.mit.edu>2019-04-05 08:15:40 +0000
commit9445403f9558901dc54c88754ff21795ea1803f3 (patch)
treea5e826dcb7275201015395e84558eed0032b043c /ui/tap-rlc-graph.c
parent053cf161734b243f836bed2870c5ea44382e2f52 (diff)
Get rid of the per-capture_file wtap_rec and Buffer.
Most code that reads from a capture_file already has its own wtap_rec and Buffer; change the remaining ones to do so as well. Change-Id: I9b7c136642bbb375848c37ebe23c9cdeffe830c3 Reviewed-on: https://code.wireshark.org/review/32732 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/tap-rlc-graph.c')
-rw-r--r--ui/tap-rlc-graph.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/ui/tap-rlc-graph.c b/ui/tap-rlc-graph.c
index 354ee9499e..cf2f48a15b 100644
--- a/ui/tap-rlc-graph.c
+++ b/ui/tap-rlc-graph.c
@@ -96,6 +96,8 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
gchar **err_msg)
{
frame_data *fdata;
+ wtap_rec rec;
+ Buffer buf;
epan_dissect_t edt;
dfilter_t *sfcode;
@@ -116,7 +118,11 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
}
/* Dissect the data from the current frame. */
- if (!cf_read_record(cf, fdata)) {
+ wtap_rec_init(&rec);
+ ws_buffer_init(&buf, 1500);
+ if (!cf_read_record(cf, fdata, &rec, &buf)) {
+ wtap_rec_cleanup(&rec);
+ ws_buffer_free(&buf);
return NULL; /* error reading the record */
}
@@ -131,8 +137,8 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
epan_dissect_prime_with_dfilter(&edt, sfcode);
- epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->rec,
- frame_tvbuff_new_buffer(&cf->provider, fdata, &cf->buf),
+ epan_dissect_run_with_taps(&edt, cf->cd_t, &rec,
+ frame_tvbuff_new_buffer(&cf->provider, fdata, &buf),
fdata, NULL);
rel_ts = edt.pi.rel_ts;
epan_dissect_cleanup(&edt);
@@ -142,6 +148,8 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
/* This "shouldn't happen", as the graph menu items won't
* even be enabled if the selected packet isn't an RLC PDU.
*/
+ wtap_rec_cleanup(&rec);
+ ws_buffer_free(&buf);
*err_msg = g_strdup("Selected packet doesn't have an RLC PDU");
return NULL;
}
@@ -149,6 +157,8 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
* to select which session he wants here */
if (th.num_hdrs>1){
/* Can only handle a single RLC channel yet */
+ wtap_rec_cleanup(&rec);
+ ws_buffer_free(&buf);
*err_msg = g_strdup("The selected packet has more than one LTE RLC channel in it.");
return NULL;
}
@@ -166,6 +176,9 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
/* Flip direction if have control PDU */
hdrs->direction = !hdrs->isControlPDU ? th.rlchdrs[0]->direction : !th.rlchdrs[0]->direction;
+ wtap_rec_cleanup(&rec);
+ ws_buffer_free(&buf);
+
return th.rlchdrs[0];
}