Squelch a couple of Clang Static Analyzer warnings.
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 5 Aug 2009 15:39:29 +0000 (15:39 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 5 Aug 2009 15:39:29 +0000 (15:39 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29304 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/wlan_stat_dlg.c
tap-iostat.c

index fc1c43c82b3ef0ed62160267134c26a703aad736..00c22157a668dfa559f7641fcb5cf0a5674c177e 100644 (file)
@@ -237,8 +237,7 @@ alloc_wlan_ep (struct _wlan_hdr *si, packet_info *pinfo _U_)
        if (!si)
                return NULL;
 
-       if (!(ep = g_malloc (sizeof(wlan_ep_t))))
-               return NULL;
+       ep = g_malloc (sizeof(wlan_ep_t));
 
        SE_COPY_ADDRESS (&ep->bssid, &si->bssid);
        ep->stats.channel = si->stats.channel;
@@ -387,10 +386,9 @@ wlanstat_packet (void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, const v
                }
 
                if (!te) {
-                       if ((te = alloc_wlan_ep (si, pinfo))) {
-                               te->next = hs->ep_list;
-                               hs->ep_list = te;
-                       }
+                       te = alloc_wlan_ep (si, pinfo);
+                       te->next = hs->ep_list;
+                       hs->ep_list = te;
                }
 
                if (!te->probe_req_searched && (si->type != 0x04) && (te->type[0x04] == 0) &&
index bb1180479b9308dc4973eea9737f3734b4968d5c..8ff9e3078c4098a398b11a543be92d39834b315e 100644 (file)
@@ -530,7 +530,7 @@ register_io_tap(io_stat_t *io, int i, const char *filter)
                        break;
                }
        }
-       if(io->items[i].calc_type!=CALC_TYPE_BYTES){
+       if(hfi && io->items[i].calc_type!=CALC_TYPE_BYTES){
                /* check that the type is compatible */
                switch(hfi->type){
                case FT_UINT8: