Re: Stack around variable rgval ist corrupted



By convention (since you don't specify), I'm assuming this rgval variable is
either an SPropValue or an LPSPropValue.

The error you're getting implies you've done something to write to memory
that wasn't allocated. The only reason you're not seeing a complaint when
you make it global is because for globals the appropriate checks wouldn't
happen until the process shuts down. Turn on pageheap for your process and I
bet it starts complaining even when you make it global.

So first thing you should do is look at how you used this variable. Did you
explicitly write to it? Did you pass it to a function that will assume it's
been allocated?

"hydrospace" <sf@xxxxxxxx> wrote in message
news:1137055777.401590.163550@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hello there,
>
> well I have a problem I guess with the memory allocation thing.
>
> We have a main function which calls some subfunctions with the
> appropriate pointer to the Profilesection. Within this function we try
> to add and configure a message service. For this we need the rgval with
> all the things needed for configuration... After doing all things and
> the subfunctions returns the error code the debugger says that the
> stack around the variable rgval is corrupted. If we define it globally
> the same code works fine. But we want to put into the function. Is
> there any possibility to free() or delete() this variable?
>
> Or can we use something like char rgval[] new = NULL; ???
>
> Any hints would be helpfull...And thanks in advance...
>
> Stefan
>


.