Ruslan Osmanov avatar Ruslan Osmanov committed 45f1100

Fix: continuous calls to EventBufferEvent::setCallbacks didn't free old fci/fcc(thanks to Marco Schuster)

Comments (0)

Files changed (2)

classes/buffer_event.c

 		PHP_EVENT_FREE_FCALL_INFO(bev->fci_read, bev->fcc_read);
 		PHP_EVENT_COPY_FCALL_INFO(bev->fci_read, bev->fcc_read, &fci_read, &fcc_read);
 	} else {
+		if (bev->fci_read) {
+			PHP_EVENT_FREE_FCALL_INFO(bev->fci_read, bev->fcc_read);
+		}
 		read_cb = NULL;
 	}
 
 		PHP_EVENT_FREE_FCALL_INFO(bev->fci_write, bev->fcc_write);
 		PHP_EVENT_COPY_FCALL_INFO(bev->fci_write, bev->fcc_write, &fci_write, &fcc_write);
 	} else {
+		if (bev->fci_write) {
+			PHP_EVENT_FREE_FCALL_INFO(bev->fci_write, bev->fcc_write);
+		}
 		write_cb = NULL;
 	}
 
 		PHP_EVENT_FREE_FCALL_INFO(bev->fci_event, bev->fcc_event);
 		PHP_EVENT_COPY_FCALL_INFO(bev->fci_event, bev->fcc_event, &fci_event, &fcc_event);
 	} else {
+		if (bev->fci_event) {
+			PHP_EVENT_FREE_FCALL_INFO(bev->fci_event, bev->fcc_event);
+		}
 		event_cb = NULL;
 	}
 
 		PHP_EVENT_FREE_FCALL_INFO(bev->fci_read, bev->fcc_read);
 		PHP_EVENT_COPY_FCALL_INFO(bev->fci_read, bev->fcc_read, &fci_read, &fcc_read);
 	} else {
+		if (bev->fci_read) {
+			PHP_EVENT_FREE_FCALL_INFO(bev->fci_read, bev->fcc_read);
+		}
 		read_cb = NULL;
 	}
 
 		PHP_EVENT_FREE_FCALL_INFO(bev->fci_write, bev->fcc_write);
 		PHP_EVENT_COPY_FCALL_INFO(bev->fci_write, bev->fcc_write, &fci_write, &fcc_write);
 	} else {
+		if (bev->fci_write) {
+			PHP_EVENT_FREE_FCALL_INFO(bev->fci_write, bev->fcc_write);
+		}
 		write_cb = NULL;
 	}
 
 		PHP_EVENT_FREE_FCALL_INFO(bev->fci_event, bev->fcc_event);
 		PHP_EVENT_COPY_FCALL_INFO(bev->fci_event, bev->fcc_event, &fci_event, &fcc_event);
 	} else {
+		if (bev->fci_event) {
+			PHP_EVENT_FREE_FCALL_INFO(bev->fci_event, bev->fcc_event);
+		}
 		event_cb = NULL;
 	}
 
   Add: implemented get_properties property handler(is called when one casts an object to array)
   Refact: removed memory alloc for empty property hashtables
   Fix: heap corruption caused by EventBufferEvent callbacks(thanks to Marco Schuster)
+  Fix: continuous calls to EventBufferEvent::setCallbacks didn't free old fci/fcc(thanks to Marco Schuster)
   Fix: possible heap corruption in EventListener's callback
   Add: EventBase::resume method
   ]]></notes>
       Add: implemented get_properties property handler(is called when one casts an object to array)
       Refact: removed memory alloc for empty property hashtables
       Fix: heap corruption caused by EventBufferEvent callbacks(thanks to Marco Schuster)
+      Fix: continuous calls to EventBufferEvent::setCallbacks didn't free old fci/fcc(thanks to Marco Schuster)
       Fix: possible heap corruption in EventListener's callback
       Add: EventBase::resume method
       ]]></notes>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.