Question: I need help with Milestone5. I have a working file, meaning that it works on Visual Studio and doesn't show any memory leaks. However, on

I need help with Milestone5.

I have a working file, meaning that it works on Visual Studio and doesn't show any memory leaks. However, on Valgrind, it shows Memory Errors. Can someone help me fix it?

My guess is that it's in the file LibApp.cpp and it's about memory allocation and deallocation.

Please help. Thank you.

All the files of the Milestone:

https://drive.google.com/file/d/1S-6vtrzMWgOE-rV_IEK3UjcvsrO97UmS/view?usp=sharing

On Valgrind it shows the following errors:

Script started, file is student_output.txt Script started, file is student_output.txt ==110143== Memcheck, a memory error detector ==110143== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==110143== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==110143== Command: ms ==110143== Loading Data Library Application:

==111103== Conditional jump or move depends on uninitialised value(s) ==111103== at 0x404318: sdds::LibApp::search(int, char) (LibApp.cpp:145) ==111103== by 0x404ABC: sdds::LibApp::removePublication() (LibApp.cpp:329) ==111103== by 0x404DC1: sdds::LibApp::run() (LibApp.cpp:415) ==111103== by 0x404F6F: runLibApp(char const*) (LibAppMain_prof.cpp:9) ==111103== by 0x405084: main (LibAppMain_prof.cpp:20) ==111103==

==140314== Use of uninitialised value of size 8 ==140314== at 0x404926: sdds::LibApp::newPublication() (LibApp.cpp:282) ==140314== by 0x404DAA: sdds::LibApp::run() (LibApp.cpp:411) ==140314== by 0x404F6F: runLibApp(char const*) (LibAppMain_prof.cpp:9) ==140314== by 0x405084: main (LibAppMain_prof.cpp:20) ==140314== ==140314== Use of uninitialised value of size 8 ==140314== at 0x40493F: sdds::LibApp::newPublication() (LibApp.cpp:284) ==140314== by 0x404DAA: sdds::LibApp::run() (LibApp.cpp:411) ==140314== by 0x404F6F: runLibApp(char const*) (LibAppMain_prof.cpp:9) ==140314== by 0x405084: main (LibAppMain_prof.cpp:20) ==140314==

Please help me fix this. Thank you!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!