HEAP CORRUPTION DETECTED BUG

Issue

This Content is from Stack Overflow. Question asked by Roahnbrine

I was creating a jagged array. However,

#include <iostream>

#include "Array.h"

int main()
{
    tArr s1 = {};

    Init(&s1);


    for (int i = 0; i < 10; ++i)
    {`enter code here`
        PushBack(&s1, i);
    }


    Release(&s1);

    return 0;
}

while implementing and executing the release function, an error occurred in the release function implementation part.

void Release(tArr* _pArr)
{
    free(_pArr->Pint);
    _pArr->Icount = 0;
    _pArr->Icountmax = 0;
}

In the above syntax, _pArr->Icount = 0; in part,

HEAP CORRUPTION DETECTED: after Normal block (#74) at 0x0000028520E7D280. CRT detected the the application wrote to memory after end of heap buffer.

The following error occurred:

please tell me….PLEASE…AJ;DSFPASOF



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?