Hello all, I am trying to write a program which does file handling. I was able to compile the program successfully without any errors or warnings. But when i run the program i get the following errors. These errors are all happening after all the parts of my program gets executed, and so i am getting the required result but along with that i am also getting the error.Any idea why this is so? I am using Fedora Core release 5 (Bordeaux) Kernel 2.6.15-1.2054_FC5smp on an i686 gcc version 4.1.0 20060304 (Red Hat 4.1.0-3) Target: i386-redhat-linux glibc-2.4-4 *** glibc detected *** ./readpro.exe: free(): invalid pointer: 0x00c5ac80 *** ======= Backtrace: ========= /lib/libc.so.6[0xb8ef18] /lib/libc.so.6(__libc_free+0x79)[0xb9241d] /lib/libc.so.6(exit+0x88)[0xb559a8] /lib/libc.so.6(__libc_start_main+0xe4)[0xb407ec] ./readpro.exe[0x8048471] ======= Memory map: ======== 00225000-00230000 r-xp 00000000 08:02 1475588 /lib/libgcc_s-4.1.0-20060304.so.1 00230000-00231000 rw-p 0000a000 08:02 1475588 /lib/libgcc_s-4.1.0-20060304.so.1 0029e000-002b7000 r-xp 00000000 08:02 1475582 /lib/ld-2.4.so 002b7000-002b8000 r--p 00018000 08:02 1475582 /lib/ld-2.4.so 002b8000-002b9000 rw-p 00019000 08:02 1475582 /lib/ld-2.4.so 00447000-00448000 r-xp 00447000 00:00 0 [vdso] 00b2b000-00c57000 r-xp 00000000 08:02 1475583 /lib/libc-2.4.so 00c57000-00c5a000 r--p 0012b000 08:02 1475583 /lib/libc-2.4.so 00c5a000-00c5b000 rw-p 0012e000 08:02 1475583 /lib/libc-2.4.so 00c5b000-00c5e000 rw-p 00c5b000 00:00 0 08048000-08049000 r-xp 00000000 08:07 7688505 /home/tom/readpro.exe 08049000-0804a000 rw-p 00000000 08:07 7688505 /home/tom/readpro.exe 0921a000-0923b000 rw-p 0921a000 00:00 0 [heap] b7f13000-b7f14000 rw-p b7f13000 00:00 0 b7f2f000-b7f31000 rw-p b7f2f000 00:00 0 bfe1b000-bfe31000 rw-p bfe1b000 00:00 0 [stack] Aborted Regards, Shafi