SyntaxFix
Write A Post
Hire A Developer
Questions
When you malloc(sizeof(struct_name)) it automatically allocates memory for the full size of the struct, you don't need to malloc each element inside.
malloc(sizeof(struct_name))
Use -fsanitize=address flag to check how you used your program memory.
-fsanitize=address