nqminds / edgesec

Secure router - reference implementation
https://edgesec.info
MIT License
6 stars 1 forks source link

test(edgesec): fix `test_edgesec()` config memory leak #518

Closed aloisklink closed 1 year ago

aloisklink commented 1 year ago

Some of the values in config were allocated on the heap by load_app_config():

https://github.com/nqminds/edgesec/blob/cbd6701393d7cd5ff3b134fb46056f206e2704b9/tests/test_edgesec.c#L350

Because of that, we must call free_app_config() to deallocate this variables.


Should we document this in the load_app_config() documentation?

https://github.com/nqminds/edgesec/blob/429d6179ec00553fe1959c105fb6dcb9a3ea4018/src/config.h#L86

codecov[bot] commented 1 year ago

Codecov Report

Merging #518 (7424a64) into main (e948bda) will increase coverage by 0.02%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #518      +/-   ##
==========================================
+ Coverage   53.54%   53.56%   +0.02%     
==========================================
  Files         144      144              
  Lines       20011    20020       +9     
==========================================
+ Hits        10714    10723       +9     
  Misses       9297     9297              
Impacted Files Coverage Δ
tests/test_edgesec.c 97.86% <100.00%> (+0.01%) :arrow_up:

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

mereacre commented 1 year ago

Yes, definitely.