Update main.c

Added more tests to ensure the proper cleanup and deallocation of memory resources.