Thank you for the fast reply,

I was trying to fix a few casting to some of the malloc I have, I didn't really finish, but around the area where it gives the error, it is still the same


The error it gives me on gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1) is:
*** glibc detected *** ./moaLib: free(): invalid size: 0x082d1040 ***
======= Backtrace: =========
/lib/libc.so.6[0x7b4a68]
/lib/libc.so.6[0x7b57f5]
/lib/libc.so.6(malloc+0x73)[0x7b67f4]
./moaLib[0x8051c18]
./moaLib[0x804a5d2]
./moaLib[0x8053718]
./moaLib[0x8048ec4]
./moaLib[0x804a3e1]
/lib/libc.so.6(__libc_start_main+0xdc)[0x7664e4]
./moaLib[0x8048981]
======= Memory map: ========
0035d000-0035e000 r-xp 0035d000 00:00 0 [vdso]
00734000-0074d000 r-xp 00000000 fd:00 1474629 /lib/ld-2.4.so
0074d000-0074e000 r-xp 00018000 fd:00 1474629 /lib/ld-2.4.so
0074e000-0074f000 rwxp 00019000 fd:00 1474629 /lib/ld-2.4.so
00751000-0087e000 r-xp 00000000 fd:00 1475722 /lib/libc-2.4.so
0087e000-00880000 r-xp 0012d000 fd:00 1475722 /lib/libc-2.4.so
00880000-00881000 rwxp 0012f000 fd:00 1475722 /lib/libc-2.4.so
00881000-00884000 rwxp 00881000 00:00 0
0088c000-008af000 r-xp 00000000 fd:00 1475724 /lib/libm-2.4.so
008af000-008b0000 r-xp 00022000 fd:00 1475724 /lib/libm-2.4.so
008b0000-008b1000 rwxp 00023000 fd:00 1475724 /lib/libm-2.4.so
00b9c000-00ba7000 r-xp 00000000 fd:00 1475725 /lib/libgcc_s-4.1.1-20060525.so.1
00ba7000-00ba8000 rwxp 0000a000 fd:00 1475725 /lib/libgcc_s-4.1.1-20060525.so.1
08048000-08056000 r-xp 00000000 fd:00 7831771 /home/mhelal/last/lib/moaLib/moaLib
08056000-08057000 rw-p 0000d000 fd:00 7831771 /home/mhelal/last/lib/moaLib/moaLib
082b0000-08315000 rw-p 082b0000 00:00 0
b7e00000-b7e21000 rw-p b7e00000 00:00 0
b7e21000-b7f00000 ---p b7e21000 00:00 0
b7f97000-b7f98000 rw-p b7f97000 00:00 0
b7fa5000-b7fa8000 rw-p b7fa5000 00:00 0
bf8ef000-bf904000 rw-p bf8ef000 00:00 0 [stack]
Aborted

thank you again,

Manal