Fix memleak on event creation due to not freeing storage object
This commit is contained in:
parent
721769993b
commit
6cd1f6b5f3
|
@ -141,7 +141,7 @@ Event::Event(
|
||||||
if (monitor->ServerId())
|
if (monitor->ServerId())
|
||||||
sql += stringtf(" AND ServerId=%u", monitor->ServerId());
|
sql += stringtf(" AND ServerId=%u", monitor->ServerId());
|
||||||
|
|
||||||
Debug(1, "%s", sql.c_str());
|
delete storage;
|
||||||
storage = nullptr;
|
storage = nullptr;
|
||||||
|
|
||||||
MYSQL_RES *result = zmDbFetch(sql);
|
MYSQL_RES *result = zmDbFetch(sql);
|
||||||
|
@ -218,6 +218,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
|
||||||
|
delete storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::~Event() {
|
Event::~Event() {
|
||||||
|
|
Loading…
Reference in New Issue