fixed memory leak while handling calibration triggers
authorrpreghen <rpreghen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 4 Apr 2010 21:15:18 +0000 (21:15 +0000)
committerrpreghen <rpreghen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 4 Apr 2010 21:15:18 +0000 (21:15 +0000)
TOF/TOFda.cxx

index b63749b..f28232d 100644 (file)
@@ -224,9 +224,15 @@ main(int argc, char **argv)
     /* retry if got no event */
     if (event==NULL) continue;
     /* check event type */
-    if (event->eventType != PHYSICS_EVENT && event->eventType != CALIBRATION_EVENT) continue;
+    if (event->eventType != PHYSICS_EVENT && event->eventType != CALIBRATION_EVENT) {
+      free(event);
+      continue;
+    }
     /* check inhibit collection */
-    if (event->eventType == PHYSICS_EVENT && inhibitCollection) continue;
+    if (event->eventType == PHYSICS_EVENT && inhibitCollection) {
+      free(event);
+      continue;
+    }
     /* increment number of physics events */
     if (event->eventType == PHYSICS_EVENT) nPhysicsEvents++;
     /* increment number of calib events */