X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnetutl.c;h=9e60dbbf1f31a7e3d9363235e2ad0421875df1bf;hp=417092e3e911aa37df76276cdc0343dd4a35534b;hb=44f9449888344866406c75b178eff83b392b3530;hpb=fca84d8a7d116c62423faf88e841daf1bee714e1 diff --git a/src/netutl.c b/src/netutl.c index 417092e3..9e60dbbf 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -126,10 +126,10 @@ cp */ conn_list_t *new_conn_list(void) { - conn_list_t *p = xmalloc(sizeof(conn_list_t)); + conn_list_t *p = xmalloc(sizeof(*p)); cp /* initialise all those stupid pointers at once */ - memset(p, '\0', sizeof(conn_list_t)); + memset(p, '\0', sizeof(*p)); p->nexthop = p; cp return p; @@ -213,7 +213,7 @@ cp return NULL; } - ip = xmalloc(sizeof(ip_mask_t)); + ip = xmalloc(sizeof(*ip)); ip->ip = ntohl(*((ip_t*)(h->h_addr_list[0]))); ip->mask = masker ? ~((1 << (32 - masker)) - 1) : 0;