mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 16:25:03 -05:00
Properly take ownership of new device address
Added addresses are transferred from dev to the existing rd. Set the address to NULL in dev to avoid free()ing it in device_free() a few lines down the road.
This commit is contained in:
parent
36921ba8d8
commit
d0fa636643
@ -1389,6 +1389,9 @@ device_add(struct player_command *cmd)
|
||||
|
||||
rd->v4_address = dev->v4_address;
|
||||
rd->v4_port = dev->v4_port;
|
||||
|
||||
/* Address is ours now */
|
||||
dev->v4_address = NULL;
|
||||
}
|
||||
|
||||
if (dev->v6_address)
|
||||
@ -1398,6 +1401,9 @@ device_add(struct player_command *cmd)
|
||||
|
||||
rd->v6_address = dev->v6_address;
|
||||
rd->v6_port = dev->v6_port;
|
||||
|
||||
/* Address is ours now */
|
||||
dev->v6_address = NULL;
|
||||
}
|
||||
|
||||
if (rd->name)
|
||||
|
Loading…
Reference in New Issue
Block a user