Found by coverity
---
src/pulse/util.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/pulse/util.c b/src/pulse/util.c
index 305673f..e4e8207 100644
--- a/src/pulse/util.c
+++ b/src/pulse/util.c
@@ -311,8 +311,11 @@ char *pa_get_fqdn(char *s, size_t l) {
hints.ai_family = AF_UNSPEC;
hints.ai_flags = AI_CANONNAME;
- if (getaddrinfo(hn, NULL, &hints, &a) < 0 || !a || !a->ai_canonname ||
!*a->ai_canonname)
+ if (getaddrinfo(hn, NULL, &hints, &a) < 0 || !a || !a->ai_canonname ||
!*a->ai_canonname) {
+ if (a)
+ freeaddrinfo(a);
return pa_strlcpy(s, hn, l);
+ }
pa_strlcpy(s, a->ai_canonname, l);
freeaddrinfo(a);
--
2.5.1
_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss