Registered wrong string with halloc in expand_one, causing potential crash.

darcs-hash:20060210003539-ac50b-523cbc848435b7f2b4239cc83da897cc65c00c1c.gz
This commit is contained in:
axel 2006-02-10 10:35:39 +10:00
parent 28f65c07b0
commit 4b2cc49aaa

View file

@ -41,6 +41,7 @@ parameter expansion.
#include "complete.h"
#include "translate.h"
#include "parse_util.h"
#include "halloc_util.h"
/**
Description for child process
@ -1607,7 +1608,7 @@ int expand_string( void *context,
{
for( i=start_count; i<al_get_count( end_out ); i++ )
{
halloc_register( context, al_get( end_out, i ) );
halloc_register( context, (void *)al_get( end_out, i ) );
}
}
@ -1650,7 +1651,7 @@ wchar_t *expand_one( void *context, wchar_t *string, int flags )
al_foreach( &l, (void(*)(const void *))&free );
al_destroy( &l );
halloc_register( context, string );
halloc_register( context, one );
return one;
}