Skip to content

Commit 09bed9d

Browse files
authored
fix: bustub shell memory leak (#660)
Signed-off-by: Alex Chi <[email protected]>
1 parent 736dfaa commit 09bed9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/shell/shell.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ auto main(int argc, char **argv) -> int {
8383
return 0;
8484
}
8585
query += query_c_str;
86+
linenoiseFree(query_c_str);
8687
if (bustub::StringUtil::EndsWith(query, ";") || bustub::StringUtil::StartsWith(query, "\\")) {
8788
break;
8889
}
8990
query += " ";
90-
linenoiseFree(query_c_str);
9191
} else {
9292
std::string query_line;
9393
std::cout << line_prompt;

0 commit comments

Comments
 (0)