WPS UPnP: Make dl_list_first() use easier for static analyzer
The preceding dl_list_len() check guarantees that dl_list_first() returns an entry and not NULL. However, that seems to be a bit too difficult path to follow for static analyzers, so add an explicit check for the dl_list_first() return value to be non-NULL to avoid warnings. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
		
							parent
							
								
									6cbdb0c537
								
							
						
					
					
						commit
						3e9fa3be62
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		|  | @ -700,11 +700,13 @@ struct subscription * subscription_start(struct upnp_wps_device_sm *sm, | ||||||
| 	if (dl_list_len(&sm->subscriptions) >= MAX_SUBSCRIPTIONS) { | 	if (dl_list_len(&sm->subscriptions) >= MAX_SUBSCRIPTIONS) { | ||||||
| 		s = dl_list_first(&sm->subscriptions, struct subscription, | 		s = dl_list_first(&sm->subscriptions, struct subscription, | ||||||
| 				  list); | 				  list); | ||||||
| 		wpa_printf(MSG_INFO, "WPS UPnP: Too many subscriptions, " | 		if (s) { | ||||||
| 			   "trashing oldest"); | 			wpa_printf(MSG_INFO, | ||||||
|  | 				   "WPS UPnP: Too many subscriptions, trashing oldest"); | ||||||
| 			dl_list_del(&s->list); | 			dl_list_del(&s->list); | ||||||
| 			subscription_destroy(s); | 			subscription_destroy(s); | ||||||
| 		} | 		} | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	s = os_zalloc(sizeof(*s)); | 	s = os_zalloc(sizeof(*s)); | ||||||
| 	if (s == NULL) | 	if (s == NULL) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Jouni Malinen
						Jouni Malinen