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) {
group_set = 1;
break;
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;
case 'i':
if (!group_set) {
......@@ -223,7 +217,5 @@ int main(int argc, char **argv) {
serve(sock, script);
free(script);
return EXIT_FAILURE;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment