diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-01-30 02:23:58 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-01-30 02:23:58 -0800 |
commit | 79e0405f6a6e56c2430d5d74b6c150d0b5d0e2fe (patch) | |
tree | 913c2d75ae2937ad4a4cb87d6a1e10ad25626593 /complete.cpp | |
parent | 316f81119f24471882f2d394cd332bcc1312da4d (diff) |
Yet more un-hallocing
Diffstat (limited to 'complete.cpp')
-rw-r--r-- | complete.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/complete.cpp b/complete.cpp index b75b940a..2e0894b6 100644 --- a/complete.cpp +++ b/complete.cpp @@ -907,15 +907,11 @@ static void complete_strings( std::vector<completion_t> &comp_out, std::vector<completion_t> &possible_comp, int flags ) { - wchar_t *wc, *tmp; - - tmp = expand_one( 0, - wcsdup(wc_escaped), EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_WILDCARDS); - if(!tmp) - return; - - wc = parse_util_unescape_wildcards( tmp ); - free(tmp); + wcstring tmp = wc_escaped; + if (! expand_one(tmp, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_WILDCARDS)) + return; + + const wchar_t *wc = parse_util_unescape_wildcards( tmp.c_str() ); for( size_t i=0; i< possible_comp.size(); i++ ) { @@ -928,7 +924,7 @@ static void complete_strings( std::vector<completion_t> &comp_out, } } - free( wc ); + free( (void *)wc ); } /** |