Useless Assignment at capture_ui_utils.c:160 |
No properties have been set. edit properties |
Jump to warning location ↓ | warning details... |
| |
get_interface_descriptive_name (/home/sate/Testcases/c/cve/wireshark-1.2.0/capture_ui_utils.c)![]() | ||||||
![]() | ||||||
143 | char * | |||||
144 | get_interface_descriptive_name(const char *if_name) | |||||
145 | { | |||||
146 | char *descr; | |||||
147 | GList *if_list; | |||||
148 | GList *if_entry; | |||||
149 | if_info_t *if_info; | |||||
150 | int err; | |||||
151 | ||||||
152 | /* Do we have a user-supplied description? */ | |||||
153 | descr = capture_dev_user_descr_find(if_name); | |||||
154 | if (descr != NULL) { | |||||
155 | /* Yes - make a copy of that. */ | |||||
156 | descr = g_strdup(descr); | |||||
157 | } else { | |||||
158 | /* No, we don't have a user-supplied description; did we get | |||||
159 | one from the OS or libpcap? */ | |||||
160 | descr = NULL;
| |||||
161 | if_list = get_interface_list(&err, NULL); | |||||
162 | if (if_list != NULL && if_name != NULL) { | |||||
163 | if_entry = if_list; | |||||
164 | do { | |||||
165 | if_info = if_entry->data; | |||||
166 | if (strcmp(if_info->name, if_name) == 0) { | |||||
167 | if (if_info->description != NULL) { | |||||
168 | /* Return a copy of that - when we free the interface | |||||
169 | list, that'll also free up the strings to which | |||||
170 | it refers. */ | |||||
171 | descr = g_strdup(if_info->description); | |||||
172 | } | |||||
173 | break; | |||||
174 | } | |||||
175 | } while ((if_entry = g_list_next(if_entry)) != NULL); | |||||
176 | } | |||||
177 | free_interface_list(if_list); | |||||
178 | ||||||
179 | if (descr == NULL) { | |||||
180 | /* The interface name is all we have, so just return a copy of that. */ | |||||
181 | descr = g_strdup(if_name); | |||||
182 | } | |||||
183 | } | |||||
184 | ||||||
185 | return descr; | |||||
186 | } | |||||
![]() |