cn-uofbasel / ccn-lite

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

fixes potential memory leak in ccn-lite-ctrl.c #341

Closed mfrey closed 5 years ago

mfrey commented 5 years ago

Contribution description

The PR checks if a call to strdup failed and also introduces a new variable which stores the newly allocated memory before it is overwritten again by a call to strtok and thus, the memory allocated by strdup can't be freed anymore.

Issues/PRs references

Fixes #327

mfrey commented 5 years ago

Remove unnecessary check, see comments

Has been addressed with the latest updated commit (rebased, push -f)

@blacksheeep Could you please approve the PR?