diff options
author | Jiri Popelka <jpopelka@redhat.com> | 2011-06-09 14:45:16 +0200 |
---|---|---|
committer | Jiri Popelka <jpopelka@redhat.com> | 2011-06-09 14:56:35 +0200 |
commit | 59a48ff5ca7f74f29e1eba7838f59f96029e8865 (patch) | |
tree | 4161879abd07300adf94fb6b8dab7c52cbf9c97c | |
parent | dc1db6d44fa86a2cae3f6bec86765172f3f649fa (diff) | |
download | libnet-59a48ff5ca7f74f29e1eba7838f59f96029e8865.tar.gz |
Coverity: REVERSE_INULL
libnet_port_list.c:142: deref_ptr: Directly dereferencing pointer "tmp".
libnet_port_list.c:130: check_after_deref: Dereferencing "tmp" before a null check.
libnet_port_list.c:197: deref_ptr: Directly dereferencing pointer "plist".
libnet_port_list.c:198: check_after_deref: Dereferencing "plist" before a null check.
-rw-r--r-- | libnet/src/libnet_port_list.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libnet/src/libnet_port_list.c b/libnet/src/libnet_port_list.c index 3523acb..781966d 100644 --- a/libnet/src/libnet_port_list.c +++ b/libnet/src/libnet_port_list.c @@ -127,7 +127,7 @@ libnet_plist_chain_new(libnet_t *l, libnet_plist_t **plist, char *token_list) if (i) { tmp->next = malloc(sizeof (libnet_plist_t)); - if (!tmp) + if (!tmp->next) { snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "libnet_build_plist_chain: malloc %s\n", strerror(errno)); @@ -194,11 +194,11 @@ libnet_plist_chain_next_pair(libnet_plist_t *plist, uint16_t *bport, uint16_t *node_cnt; uint16_t tmp_cnt; - node_cnt = &(all_lists[plist->id]); if (plist == NULL) { return (-1); } + node_cnt = &(all_lists[plist->id]); /* * We are at the end of the list. |