From 1ee85caaaec234254eaa1e0d9be5480ea1eb37d9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 15 Sep 2021 12:55:49 -0400 Subject: [PATCH] Don't crash when unable to create source. erase will call the desctructor. Fixes #3344 --- src/zm_rtsp_server.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/zm_rtsp_server.cpp b/src/zm_rtsp_server.cpp index 2276850cd..ea6f4e2b7 100644 --- a/src/zm_rtsp_server.cpp +++ b/src/zm_rtsp_server.cpp @@ -269,9 +269,8 @@ int main(int argc, char *argv[]) { Warning("Unknown format in %s", videoFifoPath.c_str()); } if (videoSource == nullptr) { - Error("Unable to create source"); + Error("Unable to create source for %s", videoFifoPath.c_str()); rtspServer->RemoveSession(sessions[monitor->Id()]->GetMediaSessionId()); - delete sessions[monitor->Id()]; sessions.erase(monitor->Id()); continue; }