The strings duplicated with strdup() for each "wurfl-information-list" token
(wi->data.name) and each "wurfl-patch-file" path (wp->patch_file_path) were
never freed: ha_wurfl_deinit() only freed the list nodes, not the strings they
own. A simple config check on a configuration using these keywords is enough to
leak them, as reported by ASAN.
Free wi->data.name and wp->patch_file_path before freeing their list nodes.
This bug has been present since the module was introduced in commit
d0027ed5b
("MEDIUM: wurfl: add Scientiamobile WURFL device detection module"). It should
be backported to all stable versions.
This fixes issue #2084.
Reported-by: Ilya Shipitsin <chipitsine@gmail.com>
list_for_each_entry_safe(wi, wi2, &global_wurfl.information_list, list) {
LIST_DELETE(&wi->list);
+ free(wi->data.name);
free(wi);
}
list_for_each_entry_safe(wp, wp2, &global_wurfl.patch_file_list, list) {
LIST_DELETE(&wp->list);
+ free(wp->patch_file_path);
free(wp);
}