Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
2b29c3bd
Commit
2b29c3bd
authored
Sep 09, 2005
by
Jon Lech Johansen
Browse files
* bonjour.c: Fixed memory leaks. Fixed IPv6 support.
parent
a0d58179
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/services_discovery/bonjour.c
View file @
2b29c3bd
...
...
@@ -119,30 +119,49 @@ static void resolve_callback(
{
char
a
[
128
];
char
*
psz_uri
=
NULL
;
AvahiStringList
*
asl
;
char
*
psz_addr
=
NULL
;
AvahiStringList
*
asl
=
NULL
;
playlist_item_t
*
p_item
=
NULL
;
msg_Dbg
(
p_sd
,
"service '%s' of type '%s' in domain '%s'"
,
name
,
type
,
domain
);
avahi_address_snprint
(
a
,
(
sizeof
(
a
)
/
sizeof
(
a
[
0
]))
-
1
,
address
);
if
(
protocol
==
AVAHI_PROTO_INET6
)
asprintf
(
&
psz_addr
,
"[%s]"
,
a
);
asl
=
avahi_string_list_find
(
txt
,
"path"
);
if
(
txt
!=
NULL
)
asl
=
avahi_string_list_find
(
txt
,
"path"
);
if
(
asl
!=
NULL
)
{
size_t
size
;
char
*
key
=
NULL
;
char
*
value
=
NULL
;
if
(
avahi_string_list_get_pair
(
asl
,
&
key
,
&
value
,
&
size
)
==
0
)
asprintf
(
&
psz_uri
,
"http://%s:%d%s"
,
a
,
port
,
value
);
if
(
avahi_string_list_get_pair
(
asl
,
&
key
,
&
value
,
&
size
)
==
0
&&
value
!=
NULL
)
{
asprintf
(
&
psz_uri
,
"http://%s:%d%s"
,
psz_addr
!=
NULL
?
psz_addr
:
a
,
port
,
value
);
}
if
(
key
!=
NULL
)
avahi_free
(
(
void
*
)
key
);
if
(
value
!=
NULL
)
avahi_free
(
(
void
*
)
value
);
}
else
{
asprintf
(
&
psz_uri
,
"http://%s:%d"
,
a
,
port
);
asprintf
(
&
psz_uri
,
"http://%s:%d"
,
psz_addr
!=
NULL
?
psz_addr
:
a
,
port
);
}
if
(
psz_addr
!=
NULL
)
free
(
(
void
*
)
psz_addr
);
if
(
psz_uri
!=
NULL
)
{
p_item
=
playlist_ItemNew
(
p_sd
,
psz_uri
,
name
);
free
(
(
void
*
)
psz_uri
);
}
if
(
p_item
!=
NULL
)
{
p_item
->
i_flags
&=
~
PLAYLIST_SKIP_FLAG
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment