Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 159774 Details for
Bug 247734
Hald does not free memory when unplug/replugging a usb device.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch fixing the problem. Tested and confirmed by customer.
it124713-device_info_leak.patch (text/plain), 2.26 KB, created by
Jose Plans
on 2007-07-23 11:12:43 UTC
(
hide
)
Description:
Patch fixing the problem. Tested and confirmed by customer.
Filename:
MIME Type:
Creator:
Jose Plans
Created:
2007-07-23 11:12:43 UTC
Size:
2.26 KB
patch
obsolete
>--- hal-0.4.2/hald/device_info.c.orig >+++ hal-0.4.2/hald/device_info.c >@@ -1,5 +1,5 @@ > /*************************************************************************** >- * CVSID: $Id: device_info.c,v 1.16.2.1 2004/11/22 21:53:50 david Exp $ >+ * CVSID: $Id: device_info.c,v 1.16.2.2 2005/03/28 19:15:19 david Exp $ > * > * device_store.c : Search for .fdi files and merge on match > * >@@ -1026,15 +1026,22 @@ > XML_Parser parser; > ParsingContext *parsing_context; > >- snprintf (buf, 511, "%s/%s", dir, filename); >+ file = NULL; >+ filebuf = NULL; >+ parser = NULL; >+ parsing_context = NULL; >+ >+ device_matched = FALSE; >+ >+ snprintf (buf, sizeof (buf), "%s/%s", dir, filename); > > /*HAL_INFO(("analysing file %s", buf)); */ > > /* open file and read it into a buffer; it's a small file... */ > file = fopen (buf, "r"); > if (file == NULL) { >- perror ("fopen"); >- return FALSE; >+ HAL_ERROR (("Could not open file %s", buf)); >+ goto out; > } > > fseek (file, 0L, SEEK_END); >@@ -1042,25 +1049,27 @@ > rewind (file); > filebuf = (char *) malloc (filesize); > if (filebuf == NULL) { >- perror ("malloc"); >- fclose (file); >- return FALSE; >+ HAL_ERROR (("Could not allocate %d bytes for file %s", filesize, buf)); >+ goto out; > } > fread (filebuf, sizeof (char), filesize, file); > >- >- /* ok, now parse the file (should probably reuse parser and say we are >- * not thread safe >- */ >- parser = XML_ParserCreate (NULL); >- > /* initialize parsing context */ > parsing_context = > (ParsingContext *) malloc (sizeof (ParsingContext)); > if (parsing_context == NULL) { >- perror ("malloc"); >- return FALSE; >+ HAL_ERROR (("Could not allocate parsing context")); >+ goto out; >+ } >+ >+ /* TODO: reuse parser >+ */ >+ parser = XML_ParserCreate (NULL); >+ if (parser == NULL) { >+ HAL_ERROR (("Could not allocate XML parser")); >+ goto out; > } >+ > parsing_context->depth = 0; > parsing_context->device_matched = FALSE; > parsing_context->match_ok = TRUE; >@@ -1095,9 +1104,15 @@ > device_matched = parsing_context->device_matched; > } > >- free (filebuf); >- fclose (file); >- free (parsing_context); >+out: >+ if (filebuf != NULL) >+ free (filebuf); >+ if (file != NULL) >+ fclose (file); >+ if (parser != NULL) >+ XML_ParserFree (parser); >+ if (parsing_context != NULL) >+ free (parsing_context); > > return device_matched; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247734
: 159774