summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-06 16:28:41 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-06 16:28:41 +0300
commit6010ddb43d35d61864f7d139287f5ba18146c6bf (patch)
tree69218a597862318c3f3b80e642130700f0d8b144 /src/common
parent9d4ce2dc78fc0c7043948252ddb3ac45875df70a (diff)
downloadhercules-6010ddb43d35d61864f7d139287f5ba18146c6bf.tar.gz
hercules-6010ddb43d35d61864f7d139287f5ba18146c6bf.tar.bz2
hercules-6010ddb43d35d61864f7d139287f5ba18146c6bf.tar.xz
hercules-6010ddb43d35d61864f7d139287f5ba18146c6bf.zip
Fix memory corruption if plugin add command line parameter without help/description.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/core.c b/src/common/core.c
index 201d4f5e8..ccd80c44b 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -230,7 +230,10 @@ bool cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, Cm
data->name = aStrdup(name);
data->shortname = shortname;
data->func = func;
- data->help = aStrdup(help);
+ if (help)
+ data->help = aStrdup(help);
+ else
+ data->help = NULL;
data->options = options;
return true;