Bug #1236
closed
Added by p3g4asus almost 12 years ago.
Updated almost 12 years ago.
Description
Hi,
In function cHelpers::IsWantedChannel(cChannel * channel, string wantedChannels) of the vdrmanager vdr plugin, a call to "free(buffer);" is missing before return statement. This causes garbage and, expecially in small memory enviroments (like mine: Openwrt ar71xx with 64 MB of RAM) also segmentation faults. Here you can find a path for the latest commit (38d1dbda48a5f973b84d6dd8d898869c8fda355a):
http://pastebin.com/PQfFwLR5
Files
- Priority changed from Normal to Immediate
Thanks for the patch.
The problem is, I am not very familiar witrh c/c++ programming and also an other guy has coded this plugin. I have added just a few features and so on.
What I am saying is, every review or patch is very welcome to improve the quality.
Lado
- Assignee set to herrlado
- Target version changed from vdr-plugin-vdrmanager-0.9 to 313
So as I understand, after each memory allocation there should be a free() call ?
herrlado wrote:
So as I understand, after each memory allocation there should be a free() call ?
Yes, this is what mainly makes c++ and the other unmanaged programming languages different from JAVA or C# (that are managed languages). When you allocate some memory in the heap (using malloc or calloc), you should use free whan you want to release it. Otherwise it will remain there and if you have no pointer to it, it will be completely unusable. Remember that after the free call you should not retain any pointer to the freed memory, because trying to read previously freed memory, causes crashes (segfaults).
OK, Thanks!
Should be now in the repository.
I will release as version 0.10, perhaps there are other changes too, I mus check it.
- Status changed from New to Feedback
I can give you positive feedback. With this release I get no segfault, while I was getting with the previouse one. You can mark this bug as closed / fixed, I think or maybe wait for other feedbacks. Thank you very much for the quick response and thanks for this great plugin / android app too.
- Status changed from Feedback to Resolved
- Target version changed from 313 to vdr-plugin-vdrmanager-0.9
- Status changed from Resolved to Closed
Also available in: Atom
PDF