BOINC / boinc

Open-source software for volunteer computing and grid computing.
https://boinc.berkeley.edu
GNU Lesser General Public License v3.0
2.03k stars 449 forks source link

Cppcheck leaks reported #1160

Closed romw closed 9 years ago

romw commented 9 years ago

Reported by serval2412 on 28 Dec 42440930 09:06 UTC Hello,

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

Julien

romw commented 9 years ago

Commented by Nicolas on 8 Jul 42442805 14:29 UTC I'm quite sure that your fix to make_app_icon_h.cpp is not correct. The bug is in the condition:

Index: api/make_app_icon_h.cpp
===================================================================
--- api/make_app_icon_h.cpp     (revisin: 25653)
+++ api/make_app_icon_h.cpp     (copia de trabajo)
@@ -40,6 +40,6 @@

     outFile = fopen(argv["w");
-    if (inFile == NULL) {
+    if (outFile == NULL) {
         printf ("Couldn't create output file %s\n", argv[2](2],));
         fclose(inFile);
         return 0;
romw commented 9 years ago

Commented by davea on 16 Apr 42442910 21:23 UTC (In [25750]) - fixes of various (non-critical) fd and memory leaks. Fixes #1188. From Julien.

romw commented 9 years ago

Commented by serval2412 on 9 May 42443450 10:46 UTC My patch contained this :

--- api/make_app_icon_h.cpp (rvision 25749) +++ api/make_app_icon_h.cpp (copie de travail) @@ -41,7 +41,7 @@ outFile = fopen(argv["w"); if (inFile == NULL) { printf ("Couldn't create output file %s\n", argv2);

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.

romw commented 9 years ago

Commented by serval2412 on 2 Jan 42443496 19:20 UTC About "outFile", I had mentionned this in Ticket #1127

romw commented 9 years ago

Commented by davea@677681c0-c3c0-48b4-bd46-92119ef6d97a on 29 Jul 42445937 12:57 UTC 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