From 23e538efa4f0c59b65fb55a0e27bbf0cf2480c01 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 23 Feb 2014 10:18:02 -0800 Subject: [PATCH] client: fix possible null dereference in create 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 --- src/client/Client.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index d4a91a088c8a7..699d369a54167 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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; } -- 2.39.5