Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(IN C) Could someone please help fix my memory leaks? I'm working on a project and the last test case I'm failing is one that

(IN C) Could someone please help fix my memory leaks? I'm working on a project and the last test case I'm failing is one that tests for leaks, below is what the autograder error displays:

==64== Conditional jump or move depends on uninitialised value(s) ==64== at 0x109C4D: getListStats (functions.c:180) ==64== by 0x1093A2: main (driver.c:30) ==64== ==64== Conditional jump or move depends on uninitialised value(s) ==64== at 0x109C86: getListStats (functions.c:183) ==64== by 0x1093A2: main (driver.c:30) ==64== ==64== Conditional jump or move depends on uninitialised value(s) ==64== at 0x109CD5: getListStats (functions.c:177) ==64== by 0x1093A2: main (driver.c:30) ==64== ==64== Conditional jump or move depends on uninitialised value(s) ==64== at 0x10972D: deleteList (functions.c:85) ==64== by 0x1093C1: main (driver.c:34) ==64== ==64== ==64== HEAP SUMMARY: ==64== in use at exit: 944 bytes in 2 blocks ==64== total heap usage: 32 allocs, 30 frees, 16,752 bytes allocated ==64== ==64== LEAK SUMMARY: ==64== definitely lost: 0 bytes in 0 blocks ==64== indirectly lost: 0 bytes in 0 blocks ==64== possibly lost: 0 bytes in 0 blocks ==64== still reachable: 944 bytes in 2 blocks ==64== suppressed: 0 bytes in 0 blocks ==64== Reachable blocks (those to which a pointer was found) are not shown. ==64== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==64== ==64== Use --track-origins=yes to see where uninitialised values come from ==64== For lists of detected and suppressed errors, rerun with: -s ==64== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)

Below is my code

driver.c

image text in transcribed

functions.h

image text in transcribedimage text in transcribed

functions.c

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Any comments or bold text to show exactly where the fixes are would be greatly appreciated, Thanks!!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Why can unreliable data be of concern to a database user?

Answered: 1 week ago

Question

=+10. Did you clearly project the brand's USP?

Answered: 1 week ago