`nice_candidate_copy` doesn't duplicate `stun_server`
Hi!
I'm using master branch of libnice with Janus WebRTC Server.
Janus crashes when using libnice commit ff9ee991 or later.
I think this is because libnice's nice_candidate_copy
does not duplicate stun_server
, but copies the pointer, so the same area is freed twice.
The output of Valgrind at the time of the crash is shown below.(G_SLICE=always-malloc)
https://gist.github.com/futr/81fc45d96c45587929e2cf46689d14c2
After adding the following code to nice_candidate_copy
, it no longer crashes.
if (copy->stun_server) {
copy->stun_server = nice_address_dup(copy->stun_server);
}