Bug 5513 - Memory leak in get_proc_cpuinfo
Summary: Memory leak in get_proc_cpuinfo
Status: RESOLVED FIXED
Alias: None
Product: liboil
Classification: Unclassified
Component: unknown (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Windows (All)
: highest normal
Assignee: David Schleef
QA Contact: David Schleef
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-05 21:20 UTC by Sergey Scobich
Modified: 2006-01-05 12:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Sergey Scobich 2006-01-05 21:20:23 UTC
Here is the part of code:

  cpuinfo = malloc(4096);
  if (cpuinfo == NULL) return NULL;

  fd = open("/proc/cpuinfo", O_RDONLY);
  if (fd < 0) return NULL;

if open() failed you need to free() cpuinfo.
It always failing on Windows platform for example.

Is it possible to exclude this function from compilation on Windows platform -
you don't need to call it at all?
Comment 1 David Schleef 2006-01-06 07:29:32 UTC
Yeah, it would be smart to not use this function on !linux.

Checked in a fix for the leak(s).  I'll eventually get to writing better code
for CPU detection on different OS's.  Right now, I think it works.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.