X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fbsd-security.c;h=46bdca9ad7ded214a3ed97ebccb6bfa9bab9e15c;hb=2627875b7d18858bc1f9f7652811e4d8c15a23eb;hp=4be79482bb6bc036871bcc539bab6b8c6d133dd2;hpb=fb2bd066c2f8b34addafe48d62550e3033a59431;p=debian%2Famanda diff --git a/common-src/bsd-security.c b/common-src/bsd-security.c index 4be7948..46bdca9 100644 --- a/common-src/bsd-security.c +++ b/common-src/bsd-security.c @@ -156,15 +156,16 @@ bsd_connect( security_seterror(&bh->sech, _("resolve_hostname(%s) did not return a canonical name\n"), hostname); (*fn)(arg, &bh->sech, S_ERROR); - return; + if (res) freeaddrinfo(res); + return; } if (res == NULL) { dbprintf(_("resolve_hostname(%s): no results\n"), hostname); security_seterror(&bh->sech, _("resolve_hostname(%s): no results\n"), hostname); (*fn)(arg, &bh->sech, S_ERROR); - amfree(canonname); - return; + amfree(canonname); + return; } for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) { @@ -576,7 +577,7 @@ stream_read_sync_callback( n = read(bs->fd, bs->databuf, sizeof(bs->databuf)); } while ((n < 0) && ((errno == EINTR) || (errno == EAGAIN))); if (n < 0) - security_stream_seterror(&bs->secstr, strerror(errno)); + security_stream_seterror(&bs->secstr, "%s", strerror(errno)); bs->len = n; } @@ -618,7 +619,7 @@ stream_read_callback( } while ((n < 0) && ((errno == EINTR) || (errno == EAGAIN))); if (n < 0) - security_stream_seterror(&bs->secstr, strerror(errno)); + security_stream_seterror(&bs->secstr, "%s", strerror(errno)); (*bs->fn)(bs->arg, bs->databuf, n); }