From e3c5f3f92deb3d726829751da826ce23b83bc355 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 14 Apr 2025 13:11:14 +0200 Subject: [PATCH] fix CID 472161 remaining 2 occurences --- src/video_capture/ndi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_capture/ndi.cpp b/src/video_capture/ndi.cpp index d48c0ca90..f604856b6 100644 --- a/src/video_capture/ndi.cpp +++ b/src/video_capture/ndi.cpp @@ -196,7 +196,7 @@ static int vidcap_ndi_init(struct vidcap_params *params, void **state) // Not required, but "correct" (see the SDK documentation) if (!s->NDIlib->initialize()) { LOG(LOG_LEVEL_ERROR) << MOD_NAME << "Cannot initialize NDI!\n"; - delete s; + vidcap_ndi_done(s); return VIDCAP_INIT_FAIL; } if ((vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) != 0u) { @@ -235,7 +235,7 @@ static int vidcap_ndi_init(struct vidcap_params *params, void **state) ref_level = strtol(val, &endptr, 0); if (ref_level < 0 || ref_level >= INT_MAX || *val == '\0' || *endptr != '\0') { LOG(LOG_LEVEL_ERROR) << MOD_NAME << "Wrong value: " << val << "!\n"; - delete s; + vidcap_ndi_done(s); return VIDCAP_INIT_NOERR; } }