Open MahdiBaghbani opened 3 years ago
freeing a pointer causes memory corruption in ccn-lite-fetch
ccn-lite-fetch
here in code: https://github.com/cn-uofbasel/ccn-lite/blob/da0d9de8d82349dff845acc62d37242dd09b3d3d/src/ccnl-utils/src/ccn-lite-fetch.c#L137-L141
assigning content and content length pointer values from pkt to external pointers and then freeing the pkt itself also removes the pointers pointing to the memory location and causes memory corruption and garbage output from any write operation: https://github.com/cn-uofbasel/ccn-lite/blob/da0d9de8d82349dff845acc62d37242dd09b3d3d/src/ccnl-utils/src/ccn-lite-fetch.c#L360
write
possible solution would be passing the pkt itself out of function and free it after write function
freeing a pointer causes memory corruption in
ccn-lite-fetch
here in code: https://github.com/cn-uofbasel/ccn-lite/blob/da0d9de8d82349dff845acc62d37242dd09b3d3d/src/ccnl-utils/src/ccn-lite-fetch.c#L137-L141
assigning content and content length pointer values from pkt to external pointers and then freeing the pkt itself also removes the pointers pointing to the memory location and causes memory corruption and garbage output from any
write
operation: https://github.com/cn-uofbasel/ccn-lite/blob/da0d9de8d82349dff845acc62d37242dd09b3d3d/src/ccnl-utils/src/ccn-lite-fetch.c#L360possible solution would be passing the pkt itself out of function and free it after
write
function