#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)
Change History (8)
Changed 12 years ago by
Attachment: | cppcheck_leaks.txt added |
---|
comment:1 Changed 12 years ago by
Owner: | set to davea |
---|
comment:2 Changed 12 years ago by
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
40 40 41 41 outFile = fopen(argv[2], "w"); 42 if ( inFile == NULL) {42 if (outFile == NULL) { 43 43 printf ("Couldn't create output file %s\n", argv[2]); 44 44 fclose(inFile); 45 45 return 0;
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 12 years ago by
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:6 Changed 12 years ago by
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
leaks reported by cppcheck