Closed notthetup closed 3 years ago
The file on which you have made changes doesn't seem to be one from the master. Did you branch off from master, made changes and created this PR ? Could you re-check ? In the latest unet.c
, the change you have made should be on line 151 (https://github.com/org-arl/unet-contrib/blob/master/unetsocket/c/unet.c#L151)
Thanks @prasadtiru fixed it.
Tested this change on Windows. Works fine.
Agreed. I will refactor back to malloc
and manually initializing all fields. I prefer that too.
In this case, it's just 4 malloc calls, so tracing them and figuring out what the manual initialization needs to be is simple. For larger libraries like fjage.c
it is more tedious to verify if malloced memory needs manual initialization etc. Hence my conclusion to jump to calloc
. It's simpler and safer and less likely to create leaks and memory-related bugs.
Updated with only "zeroing" the relevant properties.
Pending : Test on Windows