Fixed memory leak in inventory.c. fixed the cmdpu module issue on githib