Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C Heap dongs

Name: Anonymous 2011-07-18 21:19

I keep getting heap corruption with the following code:

http://pastebin.com/gGdgPiYa

it occurs @ line 132 : free(queue_poll(q));

i checked it with a debugger and my polled element was still there and not Null or anything so why isn't it allowing to be freed? Also i use the queue code with another application that doesn't free the polled element and i end up memory leaks but if i try to free the element when i'm finish using it it heap corruptions me.

Header looks like:
http://pastebin.com/AwFKQcGe


queue_init(...) is no longer used i just haven't bothered to take it out btw so pay no attention to it.

Name: Anonymous 2011-07-18 21:26

http://i.imgur.com/mh5oR.png

also little pic to show the values when it errors out, ty is the struct being freed. As you can see it's not null or anything but it still error's out due to heap corruption but if i don't free it then it leads to memory leak as i said before.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List