Bug 171587 - More cleanups and fixes for memory leaks
More cleanups and fixes for memory leaks
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: logrotate (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-23 18:55 EDT by Mateus César Gröess
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-25 08:14:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch for cleanups and memory leaks fixes (15.09 KB, patch)
2005-10-23 18:55 EDT, Mateus César Gröess
no flags Details | Diff
New version of the patch, that removes one more line which was causing problems. (15.36 KB, patch)
2005-10-24 08:27 EDT, Mateus César Gröess
no flags Details | Diff
Corrected patch. (15.36 KB, patch)
2005-10-24 14:41 EDT, Mateus César Gröess
no flags Details | Diff

  None (edit)
Description Mateus César Gröess 2005-10-23 18:55:04 EDT
Hi, I have created another patch to fix some memory leaks, close files and do
cleanups. It contains:

- free() and close() where needed;
- defConfig setup moved from logrotate.c to config.c;
- pointers of compression options are set only by allocated strings, so I could
include them in free_logInfo(), to free() properly when someone set them by
configuration file;
- new function createOutputFile(), which contains code that was duplicated in
three functions of logrotate.c;
- other minor things, let's see if this time I didn't break something.

One note:

      - In copyTruncate() (logrotate.c), I have changed the creation of output
file to use the new function createOutputFile(), but before the open() function
was between two blocks of SELINUX code and the fchmod/fchown functions were
after the second block. Now the fchmod/fchown() functions are inside the
function createOutputFile, which I put between the two blocks of SELINUX, as the
open() function was localized. I don't know how SELINUX work, so I need help
from someone to tell if this change can be a problem.
Comment 1 Mateus César Gröess 2005-10-23 18:55:04 EDT
Created attachment 120296 [details]
Patch for cleanups and memory leaks fixes
Comment 2 Mateus César Gröess 2005-10-24 08:27:30 EDT
Created attachment 120302 [details]
New version of the patch, that removes one more line which was causing problems.
Comment 3 Peter Vrabec 2005-10-24 10:30:14 EDT
U wanted type "free(newlog->uncompress_prog);" in hunk @@ -903,6 +927,7 @@ didn't u?
Comment 4 Mateus César Gröess 2005-10-24 13:43:34 EDT
Yes, I forgot to change that after copy & paste, sorry.
Comment 5 Mateus César Gröess 2005-10-24 14:41:25 EDT
Created attachment 120313 [details]
Corrected patch.

Note You need to log in before you can comment on or make changes to this bug.