#ifdef PACKET_RECV_TYPE
struct sockaddr_ll sll;
struct ifreq ifr;
- int ifindex, mask;
- int fd, ret;
+ int mask;
+ int fd;
fd = pcap_get_selectable_fd(p);
if (fd < 0)
else
mask = 0;
- ret = setsockopt(fd, SOL_PACKET, PACKET_RECV_TYPE, &mask, sizeof(mask));
+ setsockopt(fd, SOL_PACKET, PACKET_RECV_TYPE, &mask, sizeof(mask));
#endif
}
check_bridge_port(const char *br, const char *port, void *arg)
{
struct ead_instance *in;
- struct list_head *p, *tmp;
+ struct list_head *p;
list_for_each(p, &instances) {
in = list_entry(p, struct ead_instance, list);
{
#ifdef linux
struct ead_instance *in;
- struct list_head *p, *tmp;
+ struct list_head *p;
br_foreach_bridge(check_bridge, NULL);
{
char passphrase[128], passphrase1[128];
FILE *f;
- struct t_conf *tc;
struct t_confent *tcent;
struct t_pw eps_passwd;
if((bakfp = fopen(bakfile2, "wb")) == NULL &&
(unlink(bakfile2) < 0 || (bakfp = fopen(bakfile2, "wb")) == NULL)) {
fclose(passfp);
- fclose(bakfp);
+ free(bakfile);
+ free(bakfile2);
return -1;
}
#ifdef USE_RENAME
unlink(bakfile);
- if(rename(pwname, bakfile) < 0)
+ if(rename(pwname, bakfile) < 0) {
+ free(bakfile);
+ free(bakfile2);
return -1;
- if(rename(bakfile2, pwname) < 0)
+ }
+ if(rename(bakfile2, pwname) < 0) {
+ free(bakfile);
+ free(bakfile2);
return -1;
+ }
#else
unlink(bakfile);
link(pwname, bakfile);