Skip to content

Commit

Permalink
vcap/rtsp: clear cURL only if init
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPulec committed Jul 15, 2024
1 parent 278d3f5 commit fff53ae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/video_capture/rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,11 +1121,13 @@ vidcap_rtsp_done(void *state) {
free(s->vrtsp_state.control);
free(s->artsp_state.control);

rtsp_teardown(s->curl, s->uri);
if (s->curl != NULL) {
rtsp_teardown(s->curl, s->uri);

curl_easy_cleanup(s->curl);
curl_global_cleanup();
s->curl = NULL;
curl_easy_cleanup(s->curl);
curl_global_cleanup();
s->curl = NULL;
}

pthread_mutex_destroy(&s->lock);
pthread_cond_destroy(&s->keepalive_cv);
Expand Down

0 comments on commit fff53ae

Please sign in to comment.