aboutsummaryrefslogtreecommitdiffstats
path: root/extcap.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2019-09-01 14:37:38 -0400
committerRoland Knall <rknall@gmail.com>2019-12-20 19:26:38 +0000
commit2925fb0850ee3ab005dd02d69994390827c2e008 (patch)
tree94813abb14d09312998be4ac497302fb32ddb7f7 /extcap.c
parentc247a8351f4d2be224e8cc424e104d8823450f5d (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 'extcap.c')
-rw-r--r--extcap.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/extcap.c b/extcap.c
index a35ab8d214..c44e32c266 100644
--- a/extcap.c
+++ b/extcap.c
@@ -1541,7 +1541,7 @@ static gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gcha
int fd = 0;
gchar *pfx = g_strconcat(pipe_prefix, "_", ifname, NULL);
- if ((fd = create_tempfile(&temp_name, pfx, NULL)) < 0)
+ if ((fd = create_tempfile(&temp_name, pfx, NULL, NULL)) < 0)
{
g_free(pfx);
return FALSE;
@@ -1560,9 +1560,12 @@ static gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gcha
if (mkfifo(temp_name, 0600) == 0)
{
- *fifo = g_strdup(temp_name);
+ *fifo = temp_name;
+ }
+ else
+ {
+ g_free(temp_name);
}
-
return TRUE;
}
#endif