这个错误暗示了什么?

Udi*_*pta 12 c malloc pointers memory-leaks

当我试图执行我的程序时它得到的错误是这样的 -

sendip: malloc.c:4631: _int_malloc: Assertion `(unsigned long)(size)
 >= (unsigned long)(nb)' failed
Run Code Online (Sandbox Code Playgroud)

通过valgrind尝试捕获错误,得到了这个 -

   HEAP SUMMARY:
   ==3335==     in use at exit: 24 bytes in 2 blocks 
   ==3335==   total heap usage: 111 allocs, 109 frees, 7,929 bytes allocated
   ==3335== 
   ==3335== 4 bytes in 1 blocks are definitely lost in loss record 1 of 2
   ==3335==    at 0x40268A4: malloc (vg_replace_malloc.c:236)
   ==3335==    by 0x8049EEF: main (sendip.c:435)
   ==3335== 
   ==3335== 20 bytes in 1 blocks are definitely lost in loss record 2 of 2
   ==3335==    at 0x40268A4: malloc (vg_replace_malloc.c:236)
   ==3335==    by 0x4031F57: ???
   ==3335==    by 0x804A338: main (sendip.c:521)
   ==3335== 
Run Code Online (Sandbox Code Playgroud)

行号 435

              datalen = stringargument(gnuoptarg, &datarg);
      /*This is the line*/ data=(char *)malloc(datalen);
                            memcpy(data, datarg, datalen);
Run Code Online (Sandbox Code Playgroud)

如果需要我可以添加其他代码...但帮我摆脱这个?这是什么我不知道...

Lea*_*ide 5

您一定是覆盖了“数据”并忘记释放旧内容......您检查过吗?