Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed redundent free stmts #78

Merged
merged 8 commits into from
Mar 19, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions traffic-mirroring/mirroring.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,13 +919,13 @@ int main(int argc, char **argv)
log_err("Error converting source address to network "
"address %s",
src_addr[i].addr);
free(src_key);
return (EXIT_FAILURE);
}
if (bpf_map_update_elem(src_fd, src_key, &src_val, 0) < 0) {
log_err("Failed to update source endpoint bpf map");
Atul-source marked this conversation as resolved.
Show resolved Hide resolved
perror("ERROR: bpf_map_update_elem");
ret = EXIT_FAILURE;
free(src_key);
}
}
free(src_key);
Expand Down Expand Up @@ -958,14 +958,13 @@ int main(int argc, char **argv)
log_err("Failed to convert destination address to network "
"address %s",
dst_addr[i].addr);
ret = EXIT_FAILURE;
free(dst_key);
free(dst_key);
return (EXIT_FAILURE);
}
Atul-source marked this conversation as resolved.
Show resolved Hide resolved
if (bpf_map_update_elem(dst_fd, dst_key, &dst_val, 0) < 0) {
log_err("Failed to update destination endpoint bpf map");
perror("ERROR: bpf_map_update_elem");
ret = EXIT_FAILURE;
free(dst_key);
Atul-source marked this conversation as resolved.
Show resolved Hide resolved
}
}
free(dst_key);
Expand Down