diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-29 18:09:20 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-29 18:09:20 -0800 |
commit | 5d18d60e3b9f9f4d6e12f14e8c68b147429b9fb3 (patch) | |
tree | 237a5b7f0da893a50c8e0e5f247964046d51ff60 /complete.cpp | |
parent | e4d98597c7fd25daed4530aa0c484c38b66f0215 (diff) |
Squash some leaks
Diffstat (limited to 'complete.cpp')
-rw-r--r-- | complete.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/complete.cpp b/complete.cpp index 0314a4ab..ca37ec2a 100644 --- a/complete.cpp +++ b/complete.cpp @@ -977,7 +977,6 @@ void completer_t::complete_cmd( const wcstring &str, bool use_function, bool use wchar_t *nxt_path; wchar_t *state; std::vector<completion_t> possible_comp; - wchar_t *nxt_completion; wchar_t *cdpath_cpy = wcsdup(L"."); @@ -1020,7 +1019,7 @@ void completer_t::complete_cmd( const wcstring &str, bool use_function, bool use } add_slash = nxt_path[path_len-1]!=L'/'; - nxt_completion = wcsdupcat( nxt_path, + wchar_t *nxt_completion = wcsdupcat( nxt_path, add_slash?L"/":L"", cmd ); if( ! nxt_completion ) @@ -1042,6 +1041,8 @@ void completer_t::complete_cmd( const wcstring &str, bool use_function, bool use } } } + + free(nxt_completion); } free( path_cpy ); if (wants_description) @@ -1100,6 +1101,7 @@ void completer_t::complete_cmd( const wcstring &str, bool use_function, bool use ACCEPT_INCOMPLETE | DIRECTORIES_ONLY ) != EXPAND_ERROR ) { } + free(nxt_completion); } } } |