diff --git a/feeds/wlan-ap/apc/src/include/lib/timer.h b/feeds/wlan-ap/apc/src/include/lib/timer.h index 612f4f8a9..9658995b8 100755 --- a/feeds/wlan-ap/apc/src/include/lib/timer.h +++ b/feeds/wlan-ap/apc/src/include/lib/timer.h @@ -30,4 +30,9 @@ static inline timer * tm_new_set( void (*hook)(struct _timer *), void *data, uns return t; } +static inline void tm_free(timer *t) +{ + free(t); +} + #endif diff --git a/feeds/wlan-ap/apc/src/src/apc.c b/feeds/wlan-ap/apc/src/src/apc.c index 6e0b589c5..3092bd42e 100755 --- a/feeds/wlan-ap/apc/src/src/apc.c +++ b/feeds/wlan-ap/apc/src/src/apc.c @@ -26,7 +26,8 @@ static void apc_dump( struct proto * P ) static struct proto * apc_init(struct proto_config * c) { struct proto * P = mb_allocz(sizeof(struct apc_proto)); - + + printf("apc_init\n"); P->cf = c; P->debug = c->debug; P->mrtdump = c->mrtdump; diff --git a/feeds/wlan-ap/apc/src/src/hello.c b/feeds/wlan-ap/apc/src/src/hello.c index 0a89026af..38a55df1a 100755 --- a/feeds/wlan-ap/apc/src/src/hello.c +++ b/feeds/wlan-ap/apc/src/src/hello.c @@ -103,6 +103,7 @@ void apc_send_hello(struct apc_iface * ifa, int kind ) struct apc_hello2_packet ps; unsigned int length, report = 0; struct apc_spec ApcSpec; + char dst_ip[16]; if (WaitingToReelect ) return; @@ -202,8 +203,7 @@ void apc_send_hello(struct apc_iface * ifa, int kind ) length += i * sizeof(u32); - printf("HELLO packet sent via %s\n", ifa->ifname ); - char *dst_ip = malloc(16); + printf("HELLO packet sent via %s\n", ifa->ifname ); memset(dst_ip, 0, 16); if ((get_current_ip(dst_ip, IAC_IFACE)) < 0) { printf("Error: Cannot get IP for %s", IAC_IFACE); diff --git a/feeds/wlan-ap/apc/src/src/neighbor.c b/feeds/wlan-ap/apc/src/src/neighbor.c index 5b262de80..92725e1ee 100755 --- a/feeds/wlan-ap/apc/src/src/neighbor.c +++ b/feeds/wlan-ap/apc/src/src/neighbor.c @@ -36,7 +36,7 @@ reset_lists(struct apc_proto *p, struct apc_neighbor *n) struct apc_neighbor * apc_neighbor_new(struct apc_iface * ifa) { struct apc_neighbor * n = mb_allocz(sizeof(struct apc_neighbor)); - + printf("apc_new_neighbor\n"); n->ifa = ifa; add_tail(&ifa->neigh_list, NODE n); n->adj = 0; @@ -58,6 +58,8 @@ static void apc_neigh_down(struct apc_neighbor * n) rem_node(NODE n); printf("Neighbor %x on %s removed", n->rid, ifa->ifname ); + tm_free(n->inactim); + mb_free(n); } /** diff --git a/feeds/wlan-ap/interAPcomm/src/src/interAPcomm.c b/feeds/wlan-ap/interAPcomm/src/src/interAPcomm.c index 4c0be0fe3..98ec29cfa 100644 --- a/feeds/wlan-ap/interAPcomm/src/src/interAPcomm.c +++ b/feeds/wlan-ap/interAPcomm/src/src/interAPcomm.c @@ -26,6 +26,7 @@ static void receive_data_uloop(struct uloop_fd *fd, unsigned int events) printf("recvfrom() failed"); ra.cb(recv_data, recv_data_len); + free(recv_data); } @@ -41,6 +42,7 @@ static void receive_data(struct ev_loop *ev, ev_io *io, int event) printf("recvfrom() failed"); ra.cb(recv_data, recv_data_len); + free(recv_data); } diff --git a/feeds/wlan-ap/opensync/src/platform/openwrt/src/ucc_detect/src/main.c b/feeds/wlan-ap/opensync/src/platform/openwrt/src/ucc_detect/src/main.c index 9f914f265..3c5e89b57 100644 --- a/feeds/wlan-ap/opensync/src/platform/openwrt/src/ucc_detect/src/main.c +++ b/feeds/wlan-ap/opensync/src/platform/openwrt/src/ucc_detect/src/main.c @@ -130,6 +130,7 @@ static int rx_msg(struct nl_msg *msg, void* arg) struct nlattr *attr[GENL_UCC_ATTR_MAX+1]; struct voip_session *data; + char dst_ip[16]; genlmsg_parse(nlmsg_hdr(msg), 0, attr, GENL_UCC_ATTR_MAX, genl_ucc_policy); @@ -140,7 +141,6 @@ static int rx_msg(struct nl_msg *msg, void* arg) return NL_OK; } - char *dst_ip = malloc(16); memset(dst_ip, 0, 16); if((get_current_ip(dst_ip, IAC_IFACE)) < 0) { LOGI("Error: Cannot get IP for %s", IAC_IFACE);