How to free this memory?

From: bugzilla (
Date: 03/29/05

Date: 29 Mar 2005 08:46:27 -0800

hi, there,

Please help me to figure out this problem. In the following code
segment, how to free the momory allocated to "head" in {STULST*
CreateList()} in main() function? thanks


#include <stdio.h>

typedef struct
        int num;
        float score;

typedef struct STULST
        STUDENT *stu;
        struct STULST* next;

STULST* CreateList()
        STULST *head;
        head=(STULST *)malloc(sizeof(STULST));
        return head;

int main()
STULST* head;

/// how to free the memory of head;

return 0;