Browse Source

fix potential memory leak (#682)

authored-by: randomize00 <randomize00@users.noreply.github.com>
pull/684/head
randomize00 4 years ago
committed by GitHub
parent
commit
e2c687558f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/edge_utils.c

1
src/edge_utils.c

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

Loading…
Cancel
Save