Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed double free of htsp message #10

Merged
merged 1 commit into from
Mar 17, 2015

Conversation

ksooo
Copy link
Member

@ksooo ksooo commented Mar 15, 2015

Fixed double free of htsp message in CTvheadend::RenameRecording and CTvheadend::UpdateTimer.

Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00000000008dd737 in htsmsg_field_destroy (f=0x3d8fc70, msg=) at htsmsg.c:42

....
Thread 1 (Thread 0x7f9b9029a780 (LWP 1663)):
#0 0x00000000008dd737 in htsmsg_field_destroy (f=0x3d8fc70, msg=) at htsmsg.c:42
#1 0x00000000008dd9e1 in htsmsg_clear (msg=) at htsmsg.c:76
#2 htsmsg_destroy (msg=0x39cf810) at htsmsg.c:180
#3 0x00007f9b8034a48f in CTvheadend::UpdateTimer (this=0x7f9b4800e070, timer=...) at /home/kai/src/openelec/OpenELEC.tv/build.OpenELEC-Generic.x86_64-devel/kodi-pvr-add

ons-b2dc035/addons/pvr.hts/src/Tvheadend.cpp:660
#4 0x0000000000c5bda1 in PVR::CPVRClient::UpdateTimer (this=0x7f9b48005b20, timer=...) at PVRClient.cpp:986
#5 0x0000000000c60cde in PVR::CPVRClients::UpdateTimer (this=, timer=...) at PVRClients.cpp:412
#6 0x0000000000a674fa in PVR::CPVRTimerInfoTag::UpdateOnClient (this=0x7f9b40118400) at PVRTimerInfoTag.cpp:399
#7 0x0000000000a6a0bf in PVR::CPVRTimers::UpdateTimer (item=...) at PVRTimers.cpp:613

...

@ksooo ksooo added the Bug label Mar 15, 2015
@ksooo
Copy link
Member Author

ksooo commented Mar 15, 2015

UpdateTimer creates m -> SendDvrUpdate(m) -> SendAndWait(m) frees m & returns new m that was not freed by SendDvrUpdate (but UpdateTimer double freed the one it ceated and had passed over to SendAndWait). Thus, this fixes not only a double free but also a memory leak.

@Jalle19
Copy link
Contributor

Jalle19 commented Mar 16, 2015

Nice find!

@ksooo ksooo mentioned this pull request Mar 17, 2015
ksooo added a commit that referenced this pull request Mar 17, 2015
Fixed double free of htsp message
@ksooo ksooo merged commit 5339ba7 into kodi-pvr:master Mar 17, 2015
@ksooo ksooo deleted the fix-msg-double-free branch March 18, 2015 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants