aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-04 08:43:55 +0100
committerMax Kellermann <max@duempel.org>2013-12-04 08:43:55 +0100
commite1901e97c2f3f6901ca7bac31a68ac9da1e3a4ee (patch)
treefac9794063e63a6e3e870a6455f13df54ef146fe /src/output
parentd694150372408cd80b89a2e27a88f91b5f856b67 (diff)
downloadmpd-e1901e97c2f3f6901ca7bac31a68ac9da1e3a4ee.tar.gz
mpd-e1901e97c2f3f6901ca7bac31a68ac9da1e3a4ee.tar.xz
mpd-e1901e97c2f3f6901ca7bac31a68ac9da1e3a4ee.zip
system/Resolver: sockaddr_to_string() returns std::string()
No GLib memory allocation.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/HttpdOutputPlugin.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/output/HttpdOutputPlugin.cxx b/src/output/HttpdOutputPlugin.cxx
index 1d80011dd..8cbc150ad 100644
--- a/src/output/HttpdOutputPlugin.cxx
+++ b/src/output/HttpdOutputPlugin.cxx
@@ -33,8 +33,6 @@
#include "util/Domain.hxx"
#include "Log.hxx"
-#include <glib.h>
-
#include <assert.h>
#include <sys/types.h>
@@ -199,8 +197,8 @@ HttpdOutput::OnAccept(int fd, const sockaddr &address,
#ifdef HAVE_LIBWRAP
if (address.sa_family != AF_UNIX) {
- char *hostaddr = sockaddr_to_string(&address, address_length,
- IgnoreError());
+ const auto hostaddr = sockaddr_to_string(&address,
+ address_length);
// TODO: shall we obtain the program name from argv[0]?
const char *progname = "mpd";
@@ -213,13 +211,10 @@ HttpdOutput::OnAccept(int fd, const sockaddr &address,
/* tcp wrappers says no */
FormatWarning(httpd_output_domain,
"libwrap refused connection (libwrap=%s) from %s",
- progname, hostaddr);
- g_free(hostaddr);
+ progname, hostaddr.c_str());
close_socket(fd);
return;
}
-
- g_free(hostaddr);
}
#else
(void)address;