I try to use free() 4 times but i have some errors here....can anyone help? The first two are ok! i think the problem is on the last two...
Code:free (plaintext);
free (ch);
free (ciphertext);
free (newplaintext);
Code:cs091770@cs091770-Aspire-6930G:~/Desktop$ ./a.out
Please type k (length): 33
Please type the text for coding: as"this is the text to be coded"asg
this is the text to be coded
Encoding in progress...
t h i s i
s t h e
t e x t t
o b e c
o d e d
Encoding completed:
tstooh e ditxbeshted e i tc
Decoding in progress...
t s t o o
h e d
i t x b e
s h t e d
e
i t c
Decoded completed:
this is the text to be coded
*** glibc detected *** ./a.out: free(): invalid next size (fast): 0x08f4c0b0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x6c501)[0xb7624501]
/lib/libc.so.6(+0x6dd70)[0xb7625d70]
/lib/libc.so.6(cfree+0x6d)[0xb7628e5d]
./a.out[0x8048a9c]
/lib/libc.so.6(__libc_start_main+0xe7)[0xb75cece7]
./a.out[0x80484f1]
======= Memory map: ========
08048000-08049000 r-xp 00000000 08:17 3015133 /home/cs091770/Desktop/a.out
08049000-0804a000 r--p 00000000 08:17 3015133 /home/cs091770/Desktop/a.out
0804a000-0804b000 rw-p 00001000 08:17 3015133 /home/cs091770/Desktop/a.out
08f4c000-08f6d000 rw-p 00000000 00:00 0 [heap]
b7400000-b7421000 rw-p 00000000 00:00 0
b7421000-b7500000 ---p 00000000 00:00 0
b7587000-b75a1000 r-xp 00000000 08:17 7864399 /lib/libgcc_s.so.1
b75a1000-b75a2000 r--p 00019000 08:17 7864399 /lib/libgcc_s.so.1
b75a2000-b75a3000 rw-p 0001a000 08:17 7864399 /lib/libgcc_s.so.1
b75b6000-b75b8000 rw-p 00000000 00:00 0
b75b8000-b770f000 r-xp 00000000 08:17 7866647 /lib/libc-2.12.1.so
b770f000-b7710000 ---p 00157000 08:17 7866647 /lib/libc-2.12.1.so
b7710000-b7712000 r--p 00157000 08:17 7866647 /lib/libc-2.12.1.so
b7712000-b7713000 rw-p 00159000 08:17 7866647 /lib/libc-2.12.1.so
b7713000-b7716000 rw-p 00000000 00:00 0
b7716000-b773a000 r-xp 00000000 08:17 7864575 /lib/libm-2.12.1.so
b773a000-b773b000 r--p 00023000 08:17 7864575 /lib/libm-2.12.1.so
b773b000-b773c000 rw-p 00024000 08:17 7864575 /lib/libm-2.12.1.so
b774d000-b7751000 rw-p 00000000 00:00 0
b7751000-b7752000 r-xp 00000000 00:00 0 [vdso]
b7752000-b776e000 r-xp 00000000 08:17 7864373 /lib/ld-2.12.1.so
b776e000-b776f000 r--p 0001b000 08:17 7864373 /lib/ld-2.12.1.so
b776f000-b7770000 rw-p 0001c000 08:17 7864373 /lib/ld-2.12.1.so
bfe0d000-bfe2e000 rw-p 00000000 00:00 0 [stack]
Aborted