kdtree result set leaked in _gweather_find_nearest_city_index()
The kdres
result set returned by kd_nearest3
in _gweather_find_nearest_city_index()
is never freed:
==385012== 400 (160 direct, 240 indirect) bytes in 5 blocks are definitely lost in loss record 21,063 of 22,648
==385012== at 0x484282F: malloc (vg_replace_malloc.c:431)
==385012== by 0x31B926B4: kd_nearest (kdtree.c:416)
==385012== by 0x31B928FD: kd_nearest3 (kdtree.c:499)
==385012== by 0x31B939DC: _gweather_find_nearest_city_index (gweather-private.c:187)
==385012== by 0x31B906EE: gweather_location_common_deserialize (gweather-location.c:1484)
==385012== by 0x31B91B17: gweather_location_format_two_deserialize (gweather-location.c:1673)
==385012== by 0x31B91B17: gweather_location_deserialize (gweather-location.c:1744)
Looks like there should be a kd_res_free (set)
at the end for the non-NULL cases.