Input code: In ssp_main.c of CcspPandM
+int* bar()
+{ int *p12;
+ p12 = (int*)malloc(1024*1024* sizeof( int));
+ return p12;
+}
int main(int argc, char* argv[])
{ int s, svalue = -1;
errno_t rc = -1;
int ret = 0;
+ bar(); //536 line in the valgrind output[by 0x40354B: main (ssp_main.c:536)]
}
Command : root@RaspberryPi-Gateway:/usr/bin# valgrind --leak-check=full ./CcspPandMSsp
Output of valgrind:
==7627== 4,194,304 bytes in 1 blocks are possibly lost in loss record 96 of 97
==7627== at 0x48461E0: malloc (vg_replace_malloc.c:309)
==7627== by 0x40354B: main (ssp_main.c:536)
==7627==
==7627== 4,194,304 bytes in 1 blocks are possibly lost in loss record 97 of 97
==7627== at 0x48461E0: malloc (vg_replace_malloc.c:309)
==7627== by 0x4035A7: main (ssp_main.c:567)
==7627==
==7627== LEAK SUMMARY:
==7627== definitely lost: 683 bytes in 1 blocks
==7627== indirectly lost: 0 bytes in 0 blocks
==7627== possibly lost: 8,388,608 bytes in 2 blocks
==7627== still reachable: 68,647 bytes in 1,341 blocks
==7627== suppressed: 0 bytes in 0 blocks
==7627== Reachable blocks (those to which a pointer was found) are not shown.
==7627== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==7627==
==7627== For lists of detected and suppressed errors, rerun with: -s
==7627== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0) |