Skip to content
Snippets Groups Projects
Commit 74dfce8a authored by Nils Schneider's avatar Nils Schneider
Browse files

gluon-announced: do not strdup optarg

parent a7a8f373
No related branches found
No related tags found
No related merge requests found
...@@ -187,14 +187,8 @@ int main(int argc, char **argv) { ...@@ -187,14 +187,8 @@ int main(int argc, char **argv) {
group_set = 1; group_set = 1;
break; break;
case 's': case 's':
free(script); // in case -s is given multiple times script = optarg;
script = strdup(optarg);
if (script == NULL) {
perror("Couldn't duplicate string");
exit(EXIT_FAILURE);
}
break; break;
case 'i': case 'i':
if (!group_set) { if (!group_set) {
...@@ -223,7 +217,5 @@ int main(int argc, char **argv) { ...@@ -223,7 +217,5 @@ int main(int argc, char **argv) {
serve(sock, script); serve(sock, script);
free(script);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment