Hi Everyone,
I am stuck at removing element from linked list. The error I get while compiling under linux is:
*** glibc detected *** free(): invalid next size (fast): 0x0804a028 ***
Error I get from windows is:
Windows has triggered a breakpoint in test1.exe.
This may be due to a corruption of the heap, and indicates a bug in test1.exe or any of the DLLs it has loaded.
The structure and function that I use to delete are:
Code:
typedef struct text *aText;
struct line {
int size;
char *text;
aText next;
aText prev;
};
void RemoveNode(aText node) {
if (node!=NULL) {
free(node->text);
node->text=NULL;
node->next=NULL;
node->prev=NULL;
node->size=0;
free(node);
node=NULL;
}
}
When such an issue occurs? and what does it mean ?
Regards