]> git.pld-linux.org Git - packages/freewheeling.git/blame - double_free.patch
fix 'double free' crash on loop delete
[packages/freewheeling.git] / double_free.patch
CommitLineData
3676ae66
JK
1diff -dur freewheeling-4a03065f9d2f520cbd37dd560b4cae5685418153.orig/src/fweelin_block.cc freewheeling-4a03065f9d2f520cbd37dd560b4cae5685418153/src/fweelin_block.cc
2--- freewheeling-4a03065f9d2f520cbd37dd560b4cae5685418153.orig/src/fweelin_block.cc 2017-02-24 19:47:23.000000000 +0100
3+++ freewheeling-4a03065f9d2f520cbd37dd560b4cae5685418153/src/fweelin_block.cc 2017-03-17 11:14:39.000000000 +0100
4@@ -1000,7 +1000,10 @@
5 BlockExtendedData *curxt = cur->xt;
6 while (curxt != 0) {
7 BlockExtendedData *tmpxt = curxt->next;
8- delete curxt;
9+ if (curxt->GetType() == T_BED_ExtraChannel)
10+ ((BED_ExtraChannel *)curxt)->RTDelete();
11+ else
12+ delete curxt;
13 curxt = tmpxt;
14 }
15
16diff -dur freewheeling-4a03065f9d2f520cbd37dd560b4cae5685418153.orig/src/fweelin_mem.h freewheeling-4a03065f9d2f520cbd37dd560b4cae5685418153/src/fweelin_mem.h
17--- freewheeling-4a03065f9d2f520cbd37dd560b4cae5685418153.orig/src/fweelin_mem.h 2017-02-24 19:47:23.000000000 +0100
18+++ freewheeling-4a03065f9d2f520cbd37dd560b4cae5685418153/src/fweelin_mem.h 2017-03-17 11:12:46.000000000 +0100
19@@ -132,12 +132,10 @@
20 exit(1);
21 };
22 void operator delete(void *d) {
23- //printf("ERROR: Preallocated type can not be deleted directly\n");
24- //exit(1);
25-
26- // We used to give an error message-
27- // now we pass this delete on to RTDelete
28- ((Preallocated *) d)->RTDelete();
29+ // cannot pass to RTDelete as this would end with two delete executed
30+ // and destructor called twice
31+ printf("ERROR: Preallocated type can not be deleted directly\n");
32+ exit(1);
33 }
34
35 // Realtime-safe function to get a new instance of this class
This page took 0.043449 seconds and 4 git commands to generate.