You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, there's indeed a memory leak here. We confirmed this while testing a patch over at CAIDA/bgpview#5.
Here's the valgrind output:
==47277== at 0x4C2266F: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==47277== by 0x6F2E0AD: strndup (in /lib/libc.so.7)
==47277== by 0x52A8551: parse_country_cell (ipmeta_provider_netacq_edge.c:1226)
==47277== by 0x4E34A03: csv_parse (libcsv.c:400)
==47277== by 0x52A5691: read_countries (ipmeta_provider_netacq_edge.c:1394)
==47277== by 0x52A75FA: ipmeta_provider_netacq_edge_init (ipmeta_provider_netacq_edge.c:1976)
==47277== by 0x529DE1F: ipmeta_provider_init (ipmeta_provider.c:164)
==47277== by 0x529CFD2: ipmeta_enable_provider (ipmeta.c:110)
==47277== by 0x506B2BD: init_ipmeta.isra.1 (bvc_pergeovisibility.c:716)
==47277== by 0x506D6D6: bvc_pergeovisibility_init (bvc_pergeovisibility.c:1334)
==47277== by 0x5068563: consumer_init (bgpview_consumer_manager.c:225)
==47277== by 0x5068563: bgpview_consumer_manager_enable_consumer (bgpview_consumer_manager.c:359)
==47277== by 0x50685D9: bgpview_consumer_manager_enable_consumer_from_str (bgpview_consumer_manager.c:395)
I think there is a tiny memory leak when this
if
statement: https://github.com/CAIDA/libipmeta/blob/master/lib/providers/ipmeta_provider_netacq_edge.c#L1364evaluates to
false
(i.e., when the record should be ignored). In this case fields in thetmp
structure that arestrdup
'd are lost. These fields should be manuallyfree
'd, or perhaps expose the utility function at:https://github.com/CAIDA/libipmeta/blob/master/lib/ipmeta_provider.c#L72)
The text was updated successfully, but these errors were encountered: