【发布时间】:2014-07-25 05:07:13
【问题描述】:
我在处理这段代码时遇到了问题。它在 free(q->izv) 函数处中断,我收到一个调试错误:
CRT detected that the application wrote to memory after end of heap buffer
我不知道这意味着什么,所以如果我得到任何帮助,我将不胜感激。
typedef struct izvodjaci{
char *izv;
int broj;
struct izvodjaci *sled;
}IZV;
obrisi_i(IZV *p){
while (p){
IZV *q;
q = p;
p = p->sled;
if (!strcmp(q->izv,"UNKNOWN")) free(q->izv);
free(q);
}
}
提前致谢
【问题讨论】:
-
这可能只是刚刚检测到缓冲区溢出的地方,而不是实际发生的地方。假设您没有首先发现问题,请尝试将您的整个代码缩减为复制问题的小示例并将其发布在此处。
标签: c debugging buffer heap-memory