Found by the Clang static analyzer.
- if(!c) {
- logger(LOG_ERR, "send_meta() called with NULL pointer!");
- abort();
- }
-
ifdebug(META) logger(LOG_DEBUG, "Sending %d bytes of metadata to %s (%s)", length,
c->name, c->hostname);
ifdebug(META) logger(LOG_DEBUG, "Sending %d bytes of metadata to %s (%s)", length,
c->name, c->hostname);
}
ai = str2addrinfo(host, port, SOCK_DGRAM);
}
ai = str2addrinfo(host, port, SOCK_DGRAM);
+ if(!ai) {
+ free(host);
device_fd = socket(ai->ai_family, SOCK_DGRAM, IPPROTO_UDP);
if(device_fd < 0) {
device_fd = socket(ai->ai_family, SOCK_DGRAM, IPPROTO_UDP);
if(device_fd < 0) {