summaryrefslogtreecommitdiff
path: root/lib/erl_interface/src/prog
diff options
context:
space:
mode:
authorKjell Winblad <kjellwinblad@gmail.com>2021-03-17 07:16:27 +0100
committerKjell Winblad <kjellwinblad@gmail.com>2021-04-06 11:15:02 +0200
commit864ace46d89d89b6c8afd4b7515a5ab46f4ed5d7 (patch)
tree29af0aced674e9adee5969754602c1e12339aeb7 /lib/erl_interface/src/prog
parent48759a7338c59c8cc1aa635e6bb9dcd513d92593 (diff)
downloaderlang-864ace46d89d89b6c8afd4b7515a5ab46f4ed5d7.tar.gz
erl_call: Suppress code_checker warnings
Diffstat (limited to 'lib/erl_interface/src/prog')
-rw-r--r--lib/erl_interface/src/prog/erl_call.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/erl_interface/src/prog/erl_call.c b/lib/erl_interface/src/prog/erl_call.c
index 08e17bb5c6..f8f7fa6602 100644
--- a/lib/erl_interface/src/prog/erl_call.c
+++ b/lib/erl_interface/src/prog/erl_call.c
@@ -163,6 +163,8 @@ int main(int argc, char *argv[])
flags.hidden = NULL;
flags.apply = NULL;
flags.cookie = NULL;
+ flags.node = NULL;
+
ei_init();
/* Get the command line options */
@@ -175,7 +177,9 @@ int main(int argc, char *argv[])
if (i+1 >= argc) {
usage_arg(progname, "-sname ");
}
-
+ if (flags.node != NULL) {
+ free(flags.node);
+ }
flags.node = ei_chk_strdup(argv[i+1]);
i++;
flags.use_long_name = 0;
@@ -183,7 +187,9 @@ int main(int argc, char *argv[])
if (i+1 >= argc) {
usage_arg(progname, "-name ");
}
-
+ if (flags.node != NULL) {
+ free(flags.node);
+ }
flags.node = ei_chk_strdup(argv[i+1]);
i++;
flags.use_long_name = 1;
@@ -204,6 +210,9 @@ int main(int argc, char *argv[])
*address_string_end = '\0';
if (strlen(hostname_port_arg) > 0) {
flags.hostname = hostname_port_arg;
+ } else {
+ free(hostname_port_arg);
+ hostname_port_arg = NULL;
}
}
@@ -272,6 +281,9 @@ int main(int argc, char *argv[])
usage_arg(progname, "-c ");
}
flags.cookiep = 1;
+ if (flags.cookie != NULL) {
+ free(flags.cookie);
+ }
flags.cookie = ei_chk_strdup(argv[i+1]);
i++;
break;
@@ -279,6 +291,9 @@ int main(int argc, char *argv[])
if (i+1 >= argc) {
usage_arg(progname, "-n ");
}
+ if (flags.node != NULL) {
+ free(flags.node);
+ }
flags.node = ei_chk_strdup(argv[i+1]);
flags.use_long_name = 1;
i++;
@@ -287,6 +302,9 @@ int main(int argc, char *argv[])
if (i+1 >= argc) {
usage_arg(progname, "-h ");
}
+ if (flags.hidden != NULL) {
+ free(flags.hidden);
+ }
flags.hidden = ei_chk_strdup(argv[i+1]);
i++;
break;
@@ -294,6 +312,9 @@ int main(int argc, char *argv[])
if (i+1 >= argc) {
usage_arg(progname, "-x ");
}
+ if (flags.script != NULL) {
+ free(flags.script);
+ }
flags.script = ei_chk_strdup(argv[i+1]);
i++;
break;
@@ -301,6 +322,9 @@ int main(int argc, char *argv[])
if (i+1 >= argc) {
usage_arg(progname, "-a ");
}
+ if (flags.apply != NULL) {
+ free(flags.apply);
+ }
flags.apply = ei_chk_strdup(argv[i+1]);
i++;
break;