From fe3737065cbed4baf192008de7d0006847d5e889 Mon Sep 17 00:00:00 2001 From: rodrigc Date: Mon, 14 Nov 2005 13:35:08 +0000 Subject: Eliminate coredump problem introduced by last commit. Noticed by: Guido van Rooij --- usr.bin/rpcgen/rpc_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index eb74c52..81e722e 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -931,7 +931,10 @@ addarg(const char *cp) crash(); /*NOTREACHED*/ } - arglist[argcount++] = strdup(cp); + if (cp != NULL) + arglist[argcount++] = xstrdup(cp); + else + arglist[argcount++] = NULL; } @@ -943,7 +946,10 @@ putarg(int place, const char *cp) crash(); /*NOTREACHED*/ } - arglist[place] = strdup(cp); + if (cp != NULL) + arglist[place] = xstrdup(cp); + else + arglist[place] = NULL; } /* -- cgit v1.1