Fixed calls to expand_variables2() in expand.cpp

This commit is contained in:
Siteshwar Vashisht 2012-01-19 21:49:24 +05:30
parent c959584831
commit 51d7d5d0da

View file

@ -1422,7 +1422,7 @@ static int expand_variables2( wchar_t * in, std::vector<completion_t> &out, int
}
}
// free(in);
free(in);
al_destroy( &var_item_list );
return is_ok;
}
@ -1471,7 +1471,7 @@ static int expand_variables2( wchar_t * in, std::vector<completion_t> &out, int
}
else
{
// free( in );
free( in );
}
return is_ok;
@ -2128,7 +2128,7 @@ int expand_string2( const wcstring &input, std::vector<completion_t> &output, in
}
else
{
if(!expand_variables2( const_cast<wchar_t*>(next.c_str()), *out, next.size() - 1 ))
if(!expand_variables2( wcsdup(next.c_str()), *out, next.size() - 1 ))
{
return EXPAND_ERROR;
}