[Bug 564735] New: attr: memory leak
http://bugzilla.novell.com/show_bug.cgi?id=564735 http://bugzilla.novell.com/show_bug.cgi?id=564735#c0 Summary: attr: memory leak Classification: openSUSE Product: openSUSE 11.2 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bphilips@novell.com ReportedBy: jslaby@novell.com QAContact: qa@suse.de Found By: --- Blocker: --- Hi, Stanse found this error in attr of OS 11.2: Leaving function and only reference to valid memory is lost here.[text] static int attr_parse_attr_conf(struct error_context *ctx) { char *text, *t; size_t size_guess = 4096, len; FILE *file; char *pattern = ((void *)0); struct attr_action *new; int action; if (attr_actions) return 0; repeat: text = malloc(size_guess + 1); if (!text) goto fail; if ((file = fopen("/etc/xattr.conf", "r")) == ((void *)0)) { if ((*__errno_location ()) == 2) return 0; goto fail; } repeat: text = malloc(size_guess + 1); if (!text) goto fail; if ((file = fopen("/etc/xattr.conf", "r")) == ((void *)0)) { if ((*__errno_location ()) == 2) return 0; <-- here goto fail; } -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=564735 http://bugzilla.novell.com/show_bug.cgi?id=564735#c1 --- Comment #1 from Brandon Philips <bphilips@novell.com> 2009-12-18 01:29:50 UTC --- Created an attachment (id=333316) --> (http://bugzilla.novell.com/attachment.cgi?id=333316) libattr-fix-memory-leak-in-attr_copy_action.patch Subject: [PATCH] libattr: fix memory leak in attr_copy_action() stanse found that attr_copy_action returns before freeing the memory allocated for text. Move fopen() above the malloc so this is not a problem. Fixes this bug: https://bugzilla.novell.com/show_bug.cgi?id=564735 Signed-off-by: Brandon Philips <bphilips@suse.de> -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=564735 http://bugzilla.novell.com/show_bug.cgi?id=564735#c2 Brandon Philips <bphilips@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |jslaby@novell.com Severity|Normal |Major --- Comment #2 from Brandon Philips <bphilips@novell.com> 2009-12-18 01:32:18 UTC --- (In reply to comment #0)
Stanse found this error in attr of OS 11.2: Leaving function and only reference to valid memory is lost here.[text]
BTW, is there anyway to integrate stanse into the build system of attr/acl? e.g. I could just type: make stanse And it would print a report if something is wrong? Right now it seems to rely on a GUI. Maybe I am missing something. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=564735 http://bugzilla.novell.com/show_bug.cgi?id=564735#c3 Jiri Slaby <jslaby@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|jslaby@novell.com | --- Comment #3 from Jiri Slaby <jslaby@novell.com> 2009-12-23 11:04:22 UTC --- (In reply to comment #2)
BTW, is there anyway to integrate stanse into the build system of attr/acl?
e.g. I could just type:
make stanse
And it would print a report if something is wrong? Right now it seems to rely on a GUI. Maybe I am missing something.
I think it would be possible. It doesn't rely on GUI. It can either output to stdout (no --gui and --stats-build on cmdline) or to xml (--stats-build <xmlfile>) which can be later opened in GUI. The checking process is that it runs standard make to obtain filelist with build flags for proper preprocessing: JOB_FILE=`pwd`/jf make all CC=stcc and then checking: stanse --jobfile `pwd`/jf with some checkers specified, this one was memory: stanse --jobfile `pwd`/jf -c AutomatonChecker:memory.xml The memory.xml is not upstream so far, but I'll package it in the near future. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=564735 https://bugzilla.novell.com/show_bug.cgi?id=564735#c zj jia <zjjia@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zjjia@novell.com AssignedTo|bnc-team-screening@forge.pr |jeffm@novell.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=564735 https://bugzilla.novell.com/show_bug.cgi?id=564735#c Jeff Mahoney <jeffm@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|jeffm@novell.com |mszeredi@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=564735 https://bugzilla.novell.com/show_bug.cgi?id=564735#c5 Miklos Szeredi <mszeredi@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |mszeredi@novell.com Resolution| |FIXED --- Comment #5 from Miklos Szeredi <mszeredi@novell.com> 2011-11-02 17:10:50 UTC --- This is now upstream, so closing. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com