double free problem

Hi,
When i try to free a block of memory (using free()) i had previously allocated for a linked list consisting of only one struct, pointing to itself, using malloc(), i get the following error:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
*** Error in `./speller': double free or corruption (fasttop): 0x0970f5f8 ***
======= Backtrace: =========
/lib/libc.so.6[0x4174ccf2]
./speller[0x80495d6]
./speller[0x8048cd5]
/lib/libc.so.6(__libc_start_main+0xf3)[0x416f0963]
======= Memory map: ========
08048000-0804a000 r-xp 00000000 fd:01 145201     /home/jharvard/cppcode/pset6/speller
0804a000-0804b000 r--p 00001000 fd:01 145201     /home/jharvard/cppcode/pset6/speller
0804b000-0804c000 rw-p 00002000 fd:01 145201     /home/jharvard/cppcode/pset6/speller
08b62000-0971d000 rw-p 00000000 00:00 0          [heap]
416b4000-416d3000 r-xp 00000000 fd:01 401476     /usr/lib/ld-2.17.so
416d3000-416d4000 r--p 0001e000 fd:01 401476     /usr/lib/ld-2.17.so
416d4000-416d5000 rw-p 0001f000 fd:01 401476     /usr/lib/ld-2.17.so
416d7000-4188f000 r-xp 00000000 fd:01 402602     /usr/lib/libc-2.17.so
4188f000-41890000 ---p 001b8000 fd:01 402602     /usr/lib/libc-2.17.so
41890000-41892000 r--p 001b8000 fd:01 402602     /usr/lib/libc-2.17.so
41892000-41893000 rw-p 001ba000 fd:01 402602     /usr/lib/libc-2.17.so
41893000-41896000 rw-p 00000000 00:00 0 
4198e000-419a9000 r-xp 00000000 fd:01 402621     /usr/lib/libgcc_s-4.8.1-20130603.so.1
419a9000-419aa000 r--p 0001a000 fd:01 402621     /usr/lib/libgcc_s-4.8.1-20130603.so.1
419aa000-419ab000 rw-p 0001b000 fd:01 402621     /usr/lib/libgcc_s-4.8.1-20130603.so.1
b775c000-b775d000 rw-p 00000000 00:00 0 
b776c000-b7770000 rw-p 00000000 00:00 0 
b7770000-b7771000 r-xp 00000000 00:00 0          [vdso]
bfed5000-bfef6000 rw-p 00000000 00:00 0          [stack]
Aborted (core dumped) 


I'd appreciate any guidance to solve this problem.
How can we possibly help you find the error in your code, if we can't see your code?

Or did you mean to post this in the Telepath Forum instead?

lol Mikeyboy, made me chuckle :D
Topic archived. No new replies allowed.