Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@KALIWL:~/linkedlist# make runv
- Executing with valgrind...
- ==2352== Memcheck, a memory error detector
- ==2352== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
- ==2352== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
- ==2352== Command: ./p2
- ==2352==
- -------------------------------
- New node in head correct
- -------------------------------
- New node in middle correct
- -------------------------------
- New node in end correct
- -------------------------------
- :z:a:t:b:c:d:e:f:g:w Node 'd' in position: 6
- -------------------------------
- -------------------------------
- :a:t:b:c:d:e:f:g:w
- -------------------------------
- -------------------------------
- After makeNull: :a:t:b:c:d:e:f:g:w
- -------------------------------
- Node number: 9
- -------------------------------
- ==2352== Invalid read of size 8
- ==2352== at 0x10966D: listRemove(List*, int) (list.cc:100)
- ==2352== by 0x109752: listMakeNull(List*) (list.cc:132)
- ==2352== by 0x109E73: main (main.cc:49)
- ==2352== Address 0x4d5bcd8 is 8 bytes inside a block of size 16 free'd
- ==2352== at 0x4836EAB: operator delete(void*) (vg_replace_malloc.c:576)
- ==2352== by 0x109684: listRemove(List*, int) (list.cc:101)
- ==2352== by 0x109752: listMakeNull(List*) (list.cc:132)
- ==2352== by 0x109E73: main (main.cc:49)
- ==2352== Block was alloc'd at
- ==2352== at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
- ==2352== by 0x1093F3: listNodeCreate(char) (list.cc:16)
- ==2352== by 0x10946E: listInsert(List*, char, int) (list.cc:34)
- ==2352== by 0x109A1B: main (main.cc:13)
- ==2352==
- ==2352== Invalid read of size 8
- ==2352== at 0x10963E: listRemove(List*, int) (list.cc:95)
- ==2352== by 0x109752: listMakeNull(List*) (list.cc:132)
- ==2352== by 0x109E73: main (main.cc:49)
- ==2352== Address 0x4d5beb8 is 8 bytes inside a block of size 16 free'd
- ==2352== at 0x4836EAB: operator delete(void*) (vg_replace_malloc.c:576)
- ==2352== by 0x109684: listRemove(List*, int) (list.cc:101)
- ==2352== by 0x109752: listMakeNull(List*) (list.cc:132)
- ==2352== by 0x109E73: main (main.cc:49)
- ==2352== Block was alloc'd at
- ==2352== at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
- ==2352== by 0x1093F3: listNodeCreate(char) (list.cc:16)
- ==2352== by 0x10946E: listInsert(List*, char, int) (list.cc:34)
- ==2352== by 0x109A1B: main (main.cc:13)
- ==2352==
- :1
- -------------------------------
- Node Number: 1
- -------------------------------
- ==2352==
- ==2352== HEAP SUMMARY:
- ==2352== in use at exit: 48 bytes in 3 blocks
- ==2352== total heap usage: 17 allocs, 14 frees, 74,005 bytes allocated
- ==2352==
- ==2352== 16 bytes in 1 blocks are definitely lost in loss record 1 of 3
- ==2352== at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
- ==2352== by 0x1093F3: listNodeCreate(char) (list.cc:16)
- ==2352== by 0x10946E: listInsert(List*, char, int) (list.cc:34)
- ==2352== by 0x109A53: main (main.cc:17)
- ==2352==
- ==2352== 16 bytes in 1 blocks are definitely lost in loss record 2 of 3
- ==2352== at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
- ==2352== by 0x1093F3: listNodeCreate(char) (list.cc:16)
- ==2352== by 0x1094B8: listInsert(List*, char, int) (list.cc:42)
- ==2352== by 0x109B59: main (main.cc:28)
- ==2352==
- ==2352== 16 bytes in 1 blocks are definitely lost in loss record 3 of 3
- ==2352== at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
- ==2352== by 0x1093F3: listNodeCreate(char) (list.cc:16)
- ==2352== by 0x10946E: listInsert(List*, char, int) (list.cc:34)
- ==2352== by 0x109E89: main (main.cc:50)
- ==2352==
- ==2352== LEAK SUMMARY:
- ==2352== definitely lost: 48 bytes in 3 blocks
- ==2352== indirectly lost: 0 bytes in 0 blocks
- ==2352== possibly lost: 0 bytes in 0 blocks
- ==2352== still reachable: 0 bytes in 0 blocks
- ==2352== suppressed: 0 bytes in 0 blocks
- ==2352==
- ==2352== For counts of detected and suppressed errors, rerun with: -v
- ==2352== ERROR SUMMARY: 11 errors from 5 contexts (suppressed: 0 from 0)
- root@KALIWL:~/linkedlist#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement