]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add comments on some memory allocations we cannot free
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 23 Feb 2018 20:21:42 +0000 (21:21 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 23 Feb 2018 20:25:39 +0000 (21:25 +0100)
print-decnet.c
print-tcp.c

index 92361cf3e902db5f22562a65b3c5740a9bd8c0ef..ef610767e961784af672414076b17cdf8aba6115 100644 (file)
@@ -1243,6 +1243,7 @@ dnnum_string(netdissect_options *ndo, u_short dnaddr)
        u_int area = (u_short)(dnaddr & AREAMASK) >> AREASHIFT;
        u_int node = dnaddr & NODEMASK;
 
+       /* malloc() return used by the 'dnaddrtable' hash table: do not free() */
        str = (char *)malloc(siz = sizeof("00.0000"));
        if (str == NULL)
                (*ndo->ndo_error)(ndo, "dnnum_string: malloc");
index 41392f99a1852435597660653d781c66722be619..66e87492a1b178325f0c82a9ee899371b1a1a43c 100644 (file)
@@ -288,6 +288,8 @@ tcp_print(netdissect_options *ndo,
 
                         if (!th->nxt || (flags & TH_SYN)) {
                                 /* didn't find it or new conversation */
+                               /* calloc() return used by the 'tcp_seq_hash6'
+                                  hash table: do not free() */
                                 if (th->nxt == NULL) {
                                         th->nxt = (struct tcp_seq_hash6 *)
                                                 calloc(1, sizeof(*th));
@@ -343,6 +345,8 @@ tcp_print(netdissect_options *ndo,
 
                         if (!th->nxt || (flags & TH_SYN)) {
                                 /* didn't find it or new conversation */
+                               /* calloc() return used by the 'tcp_seq_hash4'
+                                  hash table: do not free() */
                                 if (th->nxt == NULL) {
                                         th->nxt = (struct tcp_seq_hash *)
                                                 calloc(1, sizeof(*th));