fix potential memory leak (#682)

authored-by: randomize00 <randomize00@users.noreply.github.com>
This commit is contained in:
randomize00 2021-04-07 16:46:40 +08:00 committed by GitHub
parent d2ddc479c7
commit e2c687558f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -688,6 +688,7 @@ static void peer_set_p2p_confirmed (n2n_edge_t * eee,
scan_tmp = find_peer_by_sock(peer, eee->known_peers);
if(scan_tmp != NULL) {
HASH_DEL(eee->known_peers, scan_tmp);
free(scan);
scan = scan_tmp;
memcpy(scan->mac_addr, mac, sizeof(n2n_mac_t));
} else {