diff --git a/src/rrd_client.c b/src/rrd_client.c
index 47333df099a1495737e4fb4afdbee6986d6d93db..e7c227b8564338c1d74ab2f29c8bd033d459944d 100644 (file)
--- a/src/rrd_client.c
+++ b/src/rrd_client.c
* but it is not specified in the current command.
* Daemon is only implied in this case if set in ENV
*/
- if (getenv(ENV_RRDCACHED_ADDRESS) != NULL)
+ char *addr = getenv(ENV_RRDCACHED_ADDRESS);
+ if (addr != NULL && strcmp(addr,"") != 0)
return 1;
else
return 0;
break;
} /* for (ai_ptr) */
+ freeaddrinfo(ai_res);
+
return (status);
} /* }}} int rrdc_connect_network */
{
int status = 0;
- if (addr == NULL)
+ if (addr == NULL) {
addr = getenv (ENV_RRDCACHED_ADDRESS);
+ }
- if (addr == NULL)
- return 0;
+ if (addr == NULL || strcmp(addr,"") == 0 ) {
+ addr = NULL;
+ return 0;
+ }
pthread_mutex_lock(&lock);