]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: fix message leaks
authorSage Weil <sage@newdream.net>
Thu, 3 Dec 2009 23:50:21 +0000 (15:50 -0800)
committerSage Weil <sage@newdream.net>
Fri, 4 Dec 2009 00:21:10 +0000 (16:21 -0800)
src/ceph.cc

index cc476f99341271733390e9e3016af6f87dabbd37..6ac28fa54e316933b84f7553deeb904de07425fa 100644 (file)
@@ -96,6 +96,7 @@ void handle_observe(MMonObserve *observe)
   lock.Lock();
   registered.insert(observe->machine_id);  
   lock.Unlock();
+  delete observe;
 }
 
 void handle_notify(MMonObserveNotify *notify)
@@ -223,6 +224,8 @@ void handle_notify(MMonObserveNotify *notify)
   }
 
   map_ver[notify->machine_id] = notify->ver;
+
+  delete notify;
 }
 
 static void send_observe_requests();
@@ -299,7 +302,7 @@ void handle_ack(MMonCommandAck *ack)
     which++;
     which = which % LAST;
 
-    if(ack->version > last_seen_version)
+    if (ack->version > last_seen_version)
       last_seen_version = ack->version;
 
     string w = ack->cmd[0];
@@ -336,6 +339,7 @@ void handle_ack(MMonCommandAck *ack)
     }
     lock.Unlock();
   }
+  delete ack;
 }
 
 void send_command()