proper fix to memleak

This commit is contained in:
Isaac Connor 2021-11-11 14:42:08 -05:00
parent 6d30f5431b
commit 036d47a832
1 changed files with 2 additions and 2 deletions

View File

@ -141,7 +141,6 @@ Event::Event(
if (monitor->ServerId()) if (monitor->ServerId())
sql += stringtf(" AND ServerId=%u", monitor->ServerId()); sql += stringtf(" AND ServerId=%u", monitor->ServerId());
delete storage;
storage = nullptr; storage = nullptr;
MYSQL_RES *result = zmDbFetch(sql); MYSQL_RES *result = zmDbFetch(sql);
@ -218,6 +217,7 @@ Event::Event(
Debug(1, "Video file is %s", video_file.c_str()); Debug(1, "Video file is %s", video_file.c_str());
} }
} // end if GetOptVideoWriter } // end if GetOptVideoWriter
if (storage != monitor->getStorage())
delete storage; delete storage;
} }