Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/andna.c b/src/andna.c
- index 1c74f4e..3293a24 100644
- --- a/src/andna.c
- +++ b/src/andna.c
- @@ -1796,7 +1796,7 @@ andna_cache *get_single_andna_c(u_int hash[MAX_IP_INT],
- {
- PACKET pkt, rpkt;
- struct single_acache_hdr req_hdr;
- - andna_cache *andna_cache, *ret=0;
- + andna_cache *ret=0;
- u_int *new_hgnodes[1];
- size_t pack_sz;
- int err, counter;
- @@ -1845,9 +1845,9 @@ andna_cache *get_single_andna_c(u_int hash[MAX_IP_INT],
- /* Unpack the waited reply */
- pack_sz=rpkt.hdr.sz;
- pack=rpkt.msg;
- - ret=andna_cache=unpack_andna_cache(pack, pack_sz, &counter,
- + ret=unpack_andna_cache(pack, pack_sz, &counter,
- ACACHE_PACK_PKT);
- - if(!andna_cache && counter < 0) {
- + if(!ret && counter < 0) {
- error("get_single_acache(): Malformed andna_cache.");
- ERROR_FINISH(ret, 0, finish);
- }
- @@ -2126,7 +2126,7 @@ finish:
- andna_cache *get_andna_cache(map_node *dst_rnode, int *counter)
- {
- PACKET pkt, rpkt;
- - andna_cache *andna_cache, *ret=0;
- + andna_cache *ret=0;
- size_t pack_sz;
- int err;
- char *pack;
- @@ -2153,9 +2153,9 @@ andna_cache *get_andna_cache(map_node *dst_rnode, int *counter)
- pack_sz=rpkt.hdr.sz;
- pack=rpkt.msg;
- - ret=andna_cache=unpack_andna_cache(pack, pack_sz, counter,
- + ret=unpack_andna_cache(pack, pack_sz, counter,
- ACACHE_PACK_PKT);
- - if(!andna_cache && counter < 0)
- + if(!ret && counter < 0)
- error("get_andna_cache(): Malformed or empty andna_cache. "
- "Cannot load it");
- diff --git a/src/andns_lib.c b/src/andns_lib.c
- index 78e9ff8..806e626 100644
- --- a/src/andns_lib.c
- +++ b/src/andns_lib.c
- @@ -104,7 +104,7 @@ int a_hdr_u(char *buf,andns_pkt *ap)
- ap->id>>=1;
- buf+=2;
- - memcpy(&c,buf,2);
- + memcpy(&c,buf,sizeof(uint8_t));
- ap->qr=(c>>7)&0x01;
- ap->p=c&0x40?ANDNS_PROTO_UDP:ANDNS_PROTO_TCP;
- ap->z=c&0x20;
- diff --git a/src/gmap.c b/src/gmap.c
- index ae0de3d..35df8a7 100644
- --- a/src/gmap.c
- +++ b/src/gmap.c
- @@ -1488,6 +1488,7 @@ map_gnode **load_extmap(char *file, quadro_group *quadg)
- fclose(fd);
- return ext_map;
- error:
- + fclose(fd);
- error("Malformed ext_map file. Aborting load_extmap().");
- return 0;
- }
- diff --git a/src/inet.c b/src/inet.c
- index 6d8b0bd..8bfb702 100644
- --- a/src/inet.c
- +++ b/src/inet.c
- @@ -272,8 +272,8 @@ void unpack_inet_prefix(inet_prefix *ip, char *pack)
- */
- int inet_addr_match(const inet_prefix *a, const inet_prefix *b, int bits)
- {
- - uint32_t *a1 = a->data;
- - uint32_t *a2 = b->data;
- + const uint32_t *a1 = a->data;
- + const uint32_t *a2 = b->data;
- int words = bits >> 0x05;
- bits &= 0x1f;
- diff --git a/src/libiptc/libiptc.c b/src/libiptc/libiptc.c
- index 6a09d72..f4d2feb 100644
- --- a/src/libiptc/libiptc.c
- +++ b/src/libiptc/libiptc.c
- @@ -509,6 +509,7 @@ new_rule:
- t = (STRUCT_STANDARD_TARGET *)GET_TARGET(e);
- if (t->target.u.target_size
- != ALIGN(sizeof(STRUCT_STANDARD_TARGET))) {
- + free(r);
- errno = EINVAL;
- return -1;
- }
- @@ -2120,6 +2121,7 @@ TC_COMMIT(TC_HANDLE_T *handle)
- errno = ret;
- free(repl->counters);
- free(repl);
- + free(newcounters);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement