diff options
author | Michael Mann <mmann78@netscape.net> | 2019-09-01 14:37:38 -0400 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2019-12-20 19:26:38 +0000 |
commit | 2925fb0850ee3ab005dd02d69994390827c2e008 (patch) | |
tree | 94813abb14d09312998be4ac497302fb32ddb7f7 /wiretap/nettrace_3gpp_32_423.c | |
parent | c247a8351f4d2be224e8cc424e104d8823450f5d (diff) |
Use g_file_open_tmp within create_tempfile
Much better to use a known library than create it ourselves.
Also remove get_tempfile_path as it's not used.
Bug: 15992
Change-Id: I17b9bd879e8bdb540f79db83c6c138f8ee724764
Reviewed-on: https://code.wireshark.org/review/34420
Reviewed-by: Tomasz Moń <desowin@gmail.com>
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'wiretap/nettrace_3gpp_32_423.c')
-rw-r--r-- | wiretap/nettrace_3gpp_32_423.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/wiretap/nettrace_3gpp_32_423.c b/wiretap/nettrace_3gpp_32_423.c index fa1481ee41..5415ab10f5 100644 --- a/wiretap/nettrace_3gpp_32_423.c +++ b/wiretap/nettrace_3gpp_32_423.c @@ -176,7 +176,7 @@ nettrace_close(wtap *wth) /* delete the temp file */ ws_unlink(file_info->tmpname); - + g_free(file_info->tmpname); } /* This attribute specification contains a timestamp that refers to the start of the @@ -813,7 +813,7 @@ create_temp_pcapng_file(wtap *wth, int *err, gchar **err_info, nettrace_3gpp_32_ wtap_open_return_val result = WTAP_OPEN_MINE; /* pcapng defs */ - GArray *shb_hdrs = g_array_new(FALSE, FALSE, sizeof(wtap_block_t)); + GArray *shb_hdrs; wtap_block_t shb_hdr; wtapng_iface_descriptions_t *idb_inf = NULL; wtap_block_t int_data; @@ -839,10 +839,13 @@ create_temp_pcapng_file(wtap *wth, int *err, gchar **err_info, nettrace_3gpp_32_ memset(&exported_pdu_info, 0x0, sizeof(exported_pdu_info_t)); - import_file_fd = create_tempfile(&(file_info->tmpname), "Wireshark_PDU_", NULL); + import_file_fd = create_tempfile(&(file_info->tmpname), "Wireshark_PDU_", NULL, NULL); + if (import_file_fd < 0) + return WTAP_OPEN_ERROR; /* Now open a file and dump to it */ /* Create data for SHB */ + shb_hdrs = g_array_new(FALSE, FALSE, sizeof(wtap_block_t)); os_info_str = g_string_new(""); get_os_version_info(os_info_str); |