Changeset 2290 in kBuild for trunk/src/kash/options.c
- Timestamp:
- Feb 27, 2009 4:08:07 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/options.c
r1238 r2290 280 280 for (nparam = 0 ; argv[nparam] ; nparam++) 281 281 continue; 282 ap = newparam = ckmalloc( (nparam + 1) * sizeof *ap);282 ap = newparam = ckmalloc(psh, (nparam + 1) * sizeof *ap); 283 283 while (*argv) { 284 *ap++ = savestr( *argv++);284 *ap++ = savestr(psh, *argv++); 285 285 } 286 286 *ap = NULL; 287 freeparam( &psh->shellparam);287 freeparam(psh, &psh->shellparam); 288 288 psh->shellparam.malloc = 1; 289 289 psh->shellparam.nparam = nparam; … … 298 298 299 299 void 300 freeparam( volatile struct shparam *param)300 freeparam(shinstance *psh, volatile struct shparam *param) 301 301 { 302 302 char **ap; … … 304 304 if (param->malloc) { 305 305 for (ap = param->p ; *ap ; ap++) 306 ckfree( *ap);307 ckfree(p aram->p);306 ckfree(psh, *ap); 307 ckfree(psh, param->p); 308 308 } 309 309 } … … 330 330 for (ap1 = psh->shellparam.p ; --n >= 0 ; ap1++) { 331 331 if (psh->shellparam.malloc) 332 ckfree( *ap1);332 ckfree(psh, *ap1); 333 333 } 334 334 ap2 = psh->shellparam.p;
Note:
See TracChangeset
for help on using the changeset viewer.