]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Check pointer before deleting 2685/head
authorhejiantao5 <hejiantao5@gmail.com>
Fri, 10 Oct 2014 07:57:05 +0000 (15:57 +0800)
committerJiantao He <hejiantao5@gmail.com>
Fri, 10 Oct 2014 11:34:06 +0000 (19:34 +0800)
Here I think should check the pointer, to avoid potential risk

Signed-off-by: Jiantao He <hejiantao5@gmail.com>
src/librados/librados.cc

index d029fe19f5693c36612011c4a3089bd76690eba7..ffa72c31e3613f29d23b75bfaa4196a97b537428 100644 (file)
@@ -1817,7 +1817,8 @@ librados::ObjectOperation::ObjectOperation()
 librados::ObjectOperation::~ObjectOperation()
 {
   ::ObjectOperation *o = (::ObjectOperation *)impl;
-  delete o;
+  if (o)
+    delete o;
 }
 
 ///////////////////////////// C API //////////////////////////////