aboutsummaryrefslogtreecommitdiff
path: root/lib/extra_opts.c
diff options
context:
space:
mode:
authorGravatar Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> 2008-04-01 09:31:27 +0000
committerGravatar Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> 2008-04-01 09:31:27 +0000
commitd001e08133763427fded92847f3366d53811abca (patch)
treee855c4367d1ad202400bd7544cd10af42ea95b68 /lib/extra_opts.c
parent8a7b252eeb78a2209ebc5cb28739772c9bdaade0 (diff)
downloadmonitoring-plugins-d001e08133763427fded92847f3366d53811abca.tar.gz
np_extra_opts now retain pointers from argv so that plugins can still overwrite sensitive options
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1971 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'lib/extra_opts.c')
-rw-r--r--lib/extra_opts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/extra_opts.c b/lib/extra_opts.c
index d46d124f..8c17fa4a 100644
--- a/lib/extra_opts.c
+++ b/lib/extra_opts.c
@@ -122,7 +122,7 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){
if(argv_new==NULL) die(STATE_UNKNOWN, _("malloc() failed!\n"));
/* starting with program name */
- argv_new[0]=strdup(argv[0]);
+ argv_new[0]=argv[0];
argc_new=1;
/* then parsed ini opts (frying them up in the same run) */
while(extra_args){
@@ -132,7 +132,7 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){
free(ea1);
}
/* finally the rest of the argv array */
- for (i=1; i<*argc; i++) argv_new[argc_new++]=strdup(argv[i]);
+ for (i=1; i<*argc; i++) argv_new[argc_new++]=argv[i];
*argc=argc_new;
/* and terminate. */
argv_new[argc_new]=NULL;