]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-tcp.c
OpenFlow: Fix the uses of the pointer to the end of current packet
[tcpdump] / print-tcp.c
index 41392f99a1852435597660653d781c66722be619..ab3dbbf3e6533d2a4ef367d82baac874b8e89f9c 100644 (file)
@@ -288,12 +288,15 @@ 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));
                                         if (th->nxt == NULL)
                                                 (*ndo->ndo_error)(ndo,
-                                                                 "tcp_print: calloc");
+                                                       S_ERR_ND_MEM_ALLOC,
+                                                       "tcp_print: calloc");
                                 }
                                 th->addr = tha;
                                 if (rev)
@@ -343,12 +346,15 @@ 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));
                                         if (th->nxt == NULL)
                                                 (*ndo->ndo_error)(ndo,
-                                                                 "tcp_print: calloc");
+                                                       S_ERR_ND_MEM_ALLOC,
+                                                       "tcp_print: calloc");
                                 }
                                 th->addr = tha;
                                 if (rev)