The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM



Thread: glibc error
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-06-2008
jim mcnamara jim mcnamara is offline
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,494
malloc is complaining that you have corrupted a pointer in some way example:
Code:
char *ptr=malloc(100);
char tmp[10={0x0};
..........
.......
ptr++;
............
..........
free(ptr);
The error happens on a realloc or a free because the pointer no longer references the same start of memory. You can get the same result by writing, say, 15 characters into the tmp string, so that you overwrote the string and changed the memory value stored in ptr.
Reply With Quote