I want to delete the first node of a linked list (You can see below the image)

Τhe structures are as follows:
typedef struct PageEntry { //Node
unsigned int page_number;
char mode;
int count, R;
struct PageEntry *next;
}PE;
typedef struct Element {
int val;
PE* pe;
}Element;
typedef struct PageTable {
int p_faults, reads, writes, disk_writes, maxFrames, usedFrames;
char* algorithm;
Element* el;
}PT;
My code for trying delete the first node is here.
PE *cur = pt->el[pos].pe;
PE *prev =NULL, *temp = cur;
if(cur->count == min){ //head node
if(cur->mode == 'W'){
pt->disk_writes++;
}
if (cur->next == NULL) {
memset(cur, 0, sizeof(PE));
free(pt->el[pos].pe);
cur = NULL;
}
else {
cur = temp->next;
free(temp);
}
I am working with Visual Studio and when i do free i get back some weird values as you can see at the sceenshot. I cant unsterstand what's happening
