diff --git a/src/generator.c b/src/generator.c index f459aedc..83ff0ac9 100644 --- a/src/generator.c +++ b/src/generator.c @@ -230,11 +230,12 @@ static bool server_alive(ckpool_t *ckp, server_instance_t *si, bool pinging) realloc_strcat(&userpass, si->pass); dealloc(cs->auth); cs->auth = http_base64(userpass); - dealloc(userpass); if (!cs->auth) { LOGWARNING("Failed to create base64 auth from %s", userpass); + dealloc(userpass); return ret; } + dealloc(userpass); fd = connect_socket(cs->url, cs->port); if (fd < 0) {