diff --git a/source/src/console.cpp b/source/src/console.cpp index eee89a7a..70ed7811 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -481,6 +481,7 @@ void savehistory() { loopv(history) { f->printf("%s\n",history[i]->buf); } + delete f; } void loadhistory() { @@ -488,9 +489,10 @@ void loadhistory() { char *line = NULL; line = strtok(histbuf, "\n"); while (line) { - history.add(new hline)->buf = line; + history.add(new hline)->buf = newstring(line); line = strtok(NULL, "\n"); } + DELETEA(histbuf); histpos = history.length(); }