mbarbon / google-protobuf-dynamic

Fast and complete Perl protobuf implementation using uPB and Google .proto parser
35 stars 18 forks source link

fix leaking environment #15

Closed trinitum closed 7 years ago

trinitum commented 7 years ago

as far as I can see upb_env_uninit uninitializes environment, but doesn't delete it itself. Fixes #14.

trinitum commented 7 years ago

With this patch I still see 24 bytes leaking when running example mentioned in #14, but the major leak on every encode is appears to be fixed.

mbarbon commented 7 years ago

With this patch I am getting:

t/033_proto2_map.t .............. Error in `/home/mattia/perl5/perlbrew/perls/perl-5.20.0/bin/perl': free(): invalid pointer: 0x00007f4e41900b58

mbarbon commented 7 years ago

Pushed a fix to the double free.

trinitum commented 7 years ago

Interesting, it did pass tests for me without complaining. Anyway, works for me w/o upb_env_uninit as well, thank you