diff options
-rw-r--r-- | usr.bin/rpcgen/rpc_main.c | 10 |
1 files 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; } /* |