Fix possible memory leak in AstStorage ctor
Reviewers: teon.banek Reviewed By: teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1553
This commit is contained in:
parent
50c75c56a4
commit
ce31ff4625
@ -7,7 +7,10 @@
|
||||
|
||||
namespace query {
|
||||
|
||||
AstStorage::AstStorage() { storage_.emplace_back(new Query(next_uid_++)); }
|
||||
AstStorage::AstStorage() {
|
||||
std::unique_ptr<Query> root(new Query(next_uid_++));
|
||||
storage_.emplace_back(std::move(root));
|
||||
}
|
||||
|
||||
Query *AstStorage::query() const {
|
||||
return dynamic_cast<Query *>(storage_[0].get());
|
||||
|
Loading…
Reference in New Issue
Block a user