]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix possible null dereference in create 1302/head
authorSage Weil <sage@inktank.com>
Sun, 23 Feb 2014 18:18:02 +0000 (10:18 -0800)
committerSage Weil <sage@inktank.com>
Sun, 23 Feb 2014 18:18:02 +0000 (10:18 -0800)
There are two paths that jump to the out label for which 'in' can be
NULL and outp can be non-NULL.  For those cases we want to fill in the
caller's pointer value (they asked for it) but we clearly cannot take
a reference.

Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
src/client/Client.cc

index d4a91a088c8a71d172975d711ec573b59ee57685..699d369a5416798d28ae120af9c96c0be3176ed3 100644 (file)
@@ -8138,7 +8138,8 @@ out:
 
   // passing an Inode in outp requires an additional ref
   if (outp) {
-    _ll_get(in);
+    if (in)
+      _ll_get(in);
     *outp = in;
   }