cn-uofbasel / ccn-lite

CCN-lite, a lightweight implementation of the CCNx protocol and its variations
ISC License
74 stars 63 forks source link

ccnl-fwd: do not set *pkt = NULL for local_producer #251

Closed cgundogan closed 6 years ago

cgundogan commented 6 years ago

Contribution description

The pkt passed to ccnl_fwd_handleInterest() is freed after the invocation of ccnl_fwd_handleInterest(). However, setting *pkt to NULL in the local_producer() code path yields mem leaks and segfaults, because NULL is tried to be freed.

Issues/PRs references

none

mfrey commented 6 years ago

However, setting *pkt to NULL in the local_producer() code path yields mem leaks and segfaults, because NULL is tried to be freed.

Where is the pkt tried to be freed? I agree, simply setting pkt to NULL seems wrong, but is the pkt really freed later?

cgundogan commented 6 years ago

ccnl_fwd_handleInterest() is invoked here, and here is the packet freed