From 93e2415924efd46cd330bf16a4c4b32a53cfa82b Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 23 Nov 2012 11:14:16 -0800 Subject: [PATCH] Fix a memory leak --- complete.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/complete.cpp b/complete.cpp index 5efa53b3b..7d697ee11 100644 --- a/complete.cpp +++ b/complete.cpp @@ -1895,7 +1895,7 @@ void complete(const wcstring &cmd, std::vector &comps, complete_ty Get the string to complete */ - current_token = wcsndup(tok_begin, cursor_pos-(tok_begin-cmd_cstr)); + current_token.assign(tok_begin, cursor_pos-(tok_begin-cmd_cstr)); if (prev_begin) {