diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-04-05 00:23:35 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-04-05 08:15:40 +0000 |
commit | 9445403f9558901dc54c88754ff21795ea1803f3 (patch) | |
tree | a5e826dcb7275201015395e84558eed0032b043c /ui/qt/rtp_analysis_dialog.cpp | |
parent | 053cf161734b243f836bed2870c5ea44382e2f52 (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/qt/rtp_analysis_dialog.cpp')
-rw-r--r-- | ui/qt/rtp_analysis_dialog.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp index bc54d70820..dab1b94a5c 100644 --- a/ui/qt/rtp_analysis_dialog.cpp +++ b/ui/qt/rtp_analysis_dialog.cpp @@ -1558,15 +1558,24 @@ void RtpAnalysisDialog::findStreams() frame_data *fdata = cap_file_.capFile()->current_frame; - if (!cf_read_record(cap_file_.capFile(), fdata)) close(); + wtap_rec rec; + Buffer buf; + wtap_rec_init(&rec); + ws_buffer_init(&buf, 1500); + if (!cf_read_record(cap_file_.capFile(), fdata, &rec, &buf)) { + wtap_rec_cleanup(&rec); + ws_buffer_free(&buf); + close(); + return; + } epan_dissect_t edt; epan_dissect_init(&edt, cap_file_.capFile()->epan, TRUE, FALSE); epan_dissect_prime_with_dfilter(&edt, sfcode); epan_dissect_prime_with_hfid(&edt, hfid_rtp_ssrc); - epan_dissect_run(&edt, cap_file_.capFile()->cd_t, &cap_file_.capFile()->rec, - frame_tvbuff_new_buffer(&cap_file_.capFile()->provider, fdata, &cap_file_.capFile()->buf), + epan_dissect_run(&edt, cap_file_.capFile()->cd_t, &rec, + frame_tvbuff_new_buffer(&cap_file_.capFile()->provider, fdata, &buf), fdata, NULL); /* @@ -1575,6 +1584,8 @@ void RtpAnalysisDialog::findStreams() */ if (!dfilter_apply_edt(sfcode, &edt)) { epan_dissect_cleanup(&edt); + wtap_rec_cleanup(&rec); + ws_buffer_free(&buf); dfilter_free(sfcode); err_str_ = tr("Please select an RTPv2 packet with an SSRC value"); updateWidgets(); @@ -1594,6 +1605,8 @@ void RtpAnalysisDialog::findStreams() if (gp == NULL || gp->len == 0) { /* XXX - should not happen, as the filter includes rtp.ssrc */ epan_dissect_cleanup(&edt); + wtap_rec_cleanup(&rec); + ws_buffer_free(&buf); err_str_ = tr("SSRC value not found."); updateWidgets(); return; @@ -1601,6 +1614,8 @@ void RtpAnalysisDialog::findStreams() fwd_statinfo_.id.ssrc = fvalue_get_uinteger(&((field_info *)gp->pdata[0])->value); epan_dissect_cleanup(&edt); + wtap_rec_cleanup(&rec); + ws_buffer_free(&buf); /* Register the tap listener */ memset(&tapinfo_, 0, sizeof(rtpstream_tapinfo_t)); |