Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1188 closed Defect (fixed)

Cppcheck leaks reported

Reported by: serval2412 Owned by: davea
Priority: Undetermined Milestone: Undetermined
Component: Undetermined Version: 7.0.25
Keywords: Cc:

Description

Hello,

I attached leaks (resource and memory leaks reported by cppcheck) and proposed a patch to revienw for all of them.

Julien

Attachments (2)

cppcheck_leaks.txt (1.3 KB) - added by serval2412 12 years ago.
leaks reported by cppcheck
patch_leaks.txt (5.4 KB) - added by serval2412 12 years ago.
proposed patch to fix these leaks

Download all attachments as: .zip

Change History (8)

Changed 12 years ago by serval2412

Attachment: cppcheck_leaks.txt added

leaks reported by cppcheck

Changed 12 years ago by serval2412

Attachment: patch_leaks.txt added

proposed patch to fix these leaks

comment:1 Changed 12 years ago by Trog Dog

Owner: set to davea

comment:2 Changed 12 years ago by Nicolas

I'm quite sure that your fix to make_app_icon_h.cpp is not correct. The bug is in the condition:

  • api/make_app_icon_h.cpp

     
    4040   
    4141    outFile = fopen(argv[2], "w");
    42     if (inFile == NULL) {
     42    if (outFile == NULL) {
    4343        printf ("Couldn't create output file %s\n", argv[2]);
    4444        fclose(inFile);
    4545        return 0;

comment:3 Changed 12 years ago by davea

Resolution: fixed
Status: newclosed

(In [25750]) - fixes of various (non-critical) fd and memory leaks.

Fixes #1188. From Julien.

  • fix bugs in setting scheduler output buffer size
  • code formatting

comment:4 Changed 12 years ago by serval2412

My patch contained this :

--- api/make_app_icon_h.cpp (révision 25749) +++ api/make_app_icon_h.cpp (copie de travail) @@ -41,7 +41,7 @@

outFile = fopen(argv[2], "w"); if (inFile == NULL) {

printf ("Couldn't create output file %s\n", argv[2]);

  • fclose(inFile);

+ fclose(outFile);

return 0;

}

But you're right it should be outFile == NULL instead of inFile == NULL

BTW, sorry again for the ticket 1189 which is just a dup.

comment:5 Changed 12 years ago by serval2412

About "outFile", I had mentionned this in Ticket #1127

comment:6 Changed 12 years ago by davea@…

commit 6c966b10c5013d3aa83f1272130d734a21728f5d Author: davea <davea@677681c0-c3c0-48b4-bd46-92119ef6d97a> Date: Sun Jun 10 05:38:34 2012 +0000

  • fixes of various (non-critical) fd and memory leaks.

Fixes #1188. From Julien.

  • fix bugs in setting scheduler output buffer size
  • code formatting

git-svn-id: http://boinc.berkeley.edu/svn/trunk/boinc@25750 677681c0-c3c0-48b4-bd46-92119ef6d97a

Note: See TracTickets for help on using tickets.