Skip to content

Commit 2abb1fd

Browse files
authored
Merge pull request #3 from DanielDewberry/master
Fix memory leak of it and it2 in void ClientCode()
2 parents 561ccc8 + f4829d1 commit 2abb1fd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Iterator/Conceptual/main.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ void ClientCode() {
122122
for (it2->First(); !it2->IsDone(); it2->Next()) {
123123
std::cout << it2->Current()->data() << std::endl;
124124
}
125+
delete it;
126+
delete it2;
125127
}
126128

127129
int main() {
128130
ClientCode();
129131
return 0;
130-
}
132+
}

0 commit comments

Comments
 (0)