From 875c585dc365f818e8945df90245a030ce15730c Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 31 Oct 2024 11:49:39 +0100 Subject: [PATCH] vcap/rtsp: unlink the (fallback) file --- src/video_capture/rtsp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video_capture/rtsp.c b/src/video_capture/rtsp.c index 54ae468b8..941b3897d 100644 --- a/src/video_capture/rtsp.c +++ b/src/video_capture/rtsp.c @@ -845,8 +845,9 @@ init_rtsp(struct rtsp_state *s) { char Vtransport[256] = ""; int port = s->vrtsp_state.port; FILE *sdp_file = tmpfile(); + const char *sdp_file_name = NULL; if (sdp_file == NULL) { - sdp_file = get_temp_file(NULL); + sdp_file = get_temp_file(&sdp_file_name); if (sdp_file == NULL) { perror("Creating SDP file"); goto error; @@ -945,6 +946,9 @@ init_rtsp(struct rtsp_state *s) { error: if(sdp_file) fclose(sdp_file); + if (sdp_file_name != NULL) { + unlink(sdp_file_name); + } return false; }