The FreeMenus() function frees all the memory allocated by the corresponding call to CreateMenus(). void FreeMenus( struct Menu *menu ); Its one argument is the Menu or MenuItem pointer that was returned by CreateMenus(). It is safe to call FreeMenus() with a NULL parameter, the function will then return immediately.