Fix Segfault when no url is selected
@@ -213,7 +213,6 @@ pubsub_tcp_topic_sender_t *pubsub_tcpTopicSender_create(
urls = pubsub_utils_url_get_url(sin, NULL);
free(sin);
}
- }
if (!sender->url) {
char *urlsCopy = strndup(urls, 1024 * 1024);
char *url;
@@ -236,6 +235,7 @@ pubsub_tcp_topic_sender_t *pubsub_tcpTopicSender_create(
sender->url = pubsub_tcpHandler_get_interface_url(sender->socketHandler);
}
free(urls);
+ }
//register publisher services using a service factory
if ((sender->url != NULL) || (sender->isPassive)) {
