Skip to content

Commit

Permalink
services_discovery: bonjour: fix uninitialized variable
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-janniaux authored and fkuehne committed Jan 11, 2023
1 parent 7399645 commit 7f552ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/services_discovery/bonjour.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ - (void)stopDiscovery;
ip_socket_address *socketAddress = (ip_socket_address *)[data bytes];

if (socketAddress) {
const char *addressStr;
const char *addressStr = NULL;
if (socketAddress->sa.sa_family == AF_INET) {
addressStr = inet_ntop(socketAddress->sa.sa_family,
(void *)&(socketAddress->ipv4.sin_addr),
Expand All @@ -151,6 +151,8 @@ - (void)stopDiscovery;
addressBuffer,
sizeof(addressBuffer));
}
else vlc_assert_unreachable();

if (addressStr != NULL) {
returnValue = [NSString stringWithUTF8String:addressStr];
}
Expand Down

0 comments on commit 7f552ee

Please sign in to comment.