From 74dfce8a3051f66b672398ada7df4c3613879c1e Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Mon, 4 Aug 2014 18:26:35 +0200 Subject: [PATCH] gluon-announced: do not strdup optarg --- package/gluon-announced/src/gluon-announced.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/package/gluon-announced/src/gluon-announced.c b/package/gluon-announced/src/gluon-announced.c index 8b4ef58a..b6758f09 100644 --- a/package/gluon-announced/src/gluon-announced.c +++ b/package/gluon-announced/src/gluon-announced.c @@ -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; }