aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow
diff options
context:
space:
mode:
authorGravatar Akshay Modi <nareshmodi@google.com>2018-06-29 13:49:21 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-29 13:52:04 -0700
commitb3c163a754574faed4337f869c2d650a9f45c09c (patch)
treeabd42429a4cb8c6df07494605a2457053af27380 /tensorflow
parent1fc55aaa8ab8f6ae93218424a3fe42a7db022eff (diff)
Initialize result_handle to nullptr so we don't try to unref when not required.
PiperOrigin-RevId: 202701234
Diffstat (limited to 'tensorflow')
-rw-r--r--tensorflow/core/common_runtime/eager/execute.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/core/common_runtime/eager/execute.cc b/tensorflow/core/common_runtime/eager/execute.cc
index 39bda9119c..7a2b477845 100644
--- a/tensorflow/core/common_runtime/eager/execute.cc
+++ b/tensorflow/core/common_runtime/eager/execute.cc
@@ -128,7 +128,7 @@ Status MaybeCopyInputToExpectedDevice(EagerOperation* op, int i,
// We are only here if the policy is warn or silent copies, so we should
// trigger a copy.
auto pre_time = Env::Default()->NowMicros();
- TensorHandle* result_handle;
+ TensorHandle* result_handle = nullptr;
Status status = EagerCopyToDevice(
*handle, ctx, expected_device->name().c_str(), &result_handle);
if (run_metadata != nullptr) {