Skip to content

Commit

Permalink
vcap/rtsp: unlink the (fallback) file
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPulec committed Oct 31, 2024
1 parent 8b33b1e commit 875c585
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/video_capture/rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 875c585

Please sign in to comment.