[BusyBox] [PATCH] Changes strdup to xstrdup

Matt Kraai kraai at alumni.carnegiemellon.edu
Mon Nov 12 17:14:35 UTC 2001


On Sun, Nov 11, 2001 at 01:23:36PM +1100, Steve Merrifield wrote:
> Here is a patch that updates strdup() to xstrdup().
>  
> It only modifies those files where memory was not previously allocated,
> or there was no NULL checking. For example, in the case of:
>  
> char *temp;
> temp = strdup();
>  
> This is now:
>  
> char *temp;
> temp = xstrdup();
>  
> However, things like this have not been changed:
>  
> struct name *temp;
> temp = xmalloc();
> temp->var = strdup();
>  
> Likewise, things like this have not been changed:
>  
> char *temp;
> temp = strdup();
> if (temp == NULL) {...}
>  
> Diffed against CVS, 2001-11-11
>  
> steve

Thanks, applied.  Are you interested in performing similar
auditing of malloc, calloc, and realloc calls?

Matt





More information about the busybox mailing list