aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-06-13 06:54:38 +1000
committerGravatar axel <axel@liljencrantz.se>2006-06-13 06:54:38 +1000
commit5d5ee87a59ba5e06f0cbd7dd94cb96257d76db1d (patch)
tree09c61c5ca1a21f625140dca3976ae8b6eaff9b9a
parentc60b62de73a3e0332930f8ed0e81d2b22ce8b4b7 (diff)
Minor code edits
darcs-hash:20060612205438-ac50b-4d7092740d5d35af3da06d0e6e99551d1cdfa123.gz
-rw-r--r--parser.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/parser.c b/parser.c
index 969c5d7a..b717bda2 100644
--- a/parser.c
+++ b/parser.c
@@ -749,7 +749,7 @@ wchar_t *parser_get_filename( void *context, const wchar_t *cmd )
/*
Allocate string long enough to hold the whole command
*/
- wchar_t *new_cmd = malloc( sizeof(wchar_t)*(wcslen(cmd)+wcslen(path)+2) );
+ wchar_t *new_cmd = halloc( context, sizeof(wchar_t)*(wcslen(cmd)+wcslen(path)+2) );
/*
We tokenize a copy of the path, since strtok modifies
its arguments
@@ -788,7 +788,6 @@ wchar_t *parser_get_filename( void *context, const wchar_t *cmd )
if( S_ISREG(buff.st_mode) )
{
free( path_cpy );
- halloc_register( context, new_cmd );
return new_cmd;
}
}
@@ -812,7 +811,6 @@ wchar_t *parser_get_filename( void *context, const wchar_t *cmd )
}
}
free( path_cpy );
- free( new_cmd );
}
return 0;