- opt_channels = (char*) poptGetArg(pc);
- if (opt_channels == NULL) {
- ERR("Missing channel name(s).\n");
+ arg_channel_list = poptGetArg(pc);
+ if (arg_channel_list == NULL) {
+ ERR("Missing channel name(s).");
+ ret = CMD_ERROR;
+ goto end;
+ }
+
+ channel_list = strdup(arg_channel_list);
+ if (channel_list == NULL) {
+ PERROR("Failed to copy channel name");