diff --git a/recorder.c b/recorder.c index 35fa329..df79c2e 100644 --- a/recorder.c +++ b/recorder.c @@ -1405,12 +1405,18 @@ int main(int argc, char **argv) return (-1); } - /* - * Push list of topics into the array so that we can - * (re)subscribe in on_connect() - */ + if (argc >= 1) { /* topics on command line override config */ + + /* + * Push list of topics into the array so that we can + * (re)subscribe in on_connect() + */ + + if (ud->topics != NULL) { + json_delete(ud->topics); + ud->topics = NULL; + } - if (ud->topics == NULL) { ud->topics = json_mkarray(); for (i = 0; i < argc; i++) {