diff --git a/src/zm_event.cpp b/src/zm_event.cpp index aad16a767..9f1124e7b 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -141,7 +141,6 @@ Event::Event( if (monitor->ServerId()) sql += stringtf(" AND ServerId=%u", monitor->ServerId()); - delete storage; storage = nullptr; MYSQL_RES *result = zmDbFetch(sql); @@ -218,7 +217,8 @@ Event::Event( Debug(1, "Video file is %s", video_file.c_str()); } } // end if GetOptVideoWriter - delete storage; + if (storage != monitor->getStorage()) + delete storage; } Event::~Event() {