Re: c code, works on linux, crashes on windows

From: Willem (willem_at_stack.nl)
Date: 02/27/05


Date: Sun, 27 Feb 2005 19:22:50 +0000 (UTC)

Jerry wrote:
) ...
) free(current);
) }
) temp = current;
) current = current->next;
) ...
)
) that code will run perfect on linux when compiled but under windows
) crashes at the line with the arrow, i am lost as to what is causing it.
) any help would be great.

You're not supposed to use the contents of 'current' after you have
freed it. That it works on linux is dumb luck. Change your code so
it only frees stuff when you're really done with it.

SaSW, Willem

-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT


Relevant Pages

  • Re: roll call (which linux is the best today?)
    ... >> But it turned into this Linux rage instead. ... > If you are so sensitive and paranoid that you think people are accusing ... > I tried to help but all I have gotten is ranting about how you don't ... > It is not human nature to bite off the hand that has tried to help the way ...
    (alt.os.linux)
  • Re: roll call (which linux is the best today?)
    ... to decide the best Linux for you. ... If you are so sensitive and paranoid that you think people are accusing you ... I tried to help but all I have gotten is ranting about how you don't ... It is not human nature to bite off the hand that has tried to help the way ...
    (alt.os.linux)
  • Re: ODE -- The Other Desktop Environment
    ... Been studying Linux ... Yet somehow I manage to do a very good job of running Linux without ... How could a "paranoid loon" accomplish that? ...
    (comp.os.linux.misc)
  • Re: latest stratagy to disrupt COLA
    ... >> That group is nothing but a wasteland filled with oddballs who think Linux ... >> is great and are so paranoid they actually believe Microsoft is out to get them. ... > blah blah blah ...
    (comp.os.linux.misc)
  • Re: c code, works on linux, crashes on windows
    ... that code will run perfect on linux when compiled but under windows ... crashes at the line with the arrow, i am lost as to what is causing it. ... You all think I'm paranoid, ...
    (comp.programming)