pvaibhav / xnu-speedstep

Automatically exported from code.google.com/p/xnu-speedstep
0 stars 0 forks source link

Memory Leak in getFreqList, getVoltageList #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load kernel extension

What is the expected output? What do you see instead?
Memory leak in getFreqList, getVoltageList as used by start.

What version of the kext are you using? On what kernel and processor?
Tip of trunk.

The following change should resolve the memory leak. It is not a big issue, but 
it's nice to keep 
memory clean.  I haven't tested it, but if I'm reading the code correctly it 
should be fine.

261,262c261,267
<   strcpy(frequencyList, getFreqList());
<   strcpy(originalVoltages, getVoltageList(true));

---
>   char* freqList = getFreqList();
>   strcpy(frequencyList, freqList);
>   delete[] freqList;
> 
>   char* voltageList = getVoltageList(true);
>   strcpy(originalVoltages, voltageList);
>   delete[] voltageList;

Original issue reported on code.google.com by mconb...@gmail.com on 31 Aug 2008 at 11:30

GoogleCodeExporter commented 8 years ago
Thanks, will fix.

Original comment by prashant...@gmail.com on 8 Sep 2008 at 11:32