From 1280a8002fd42bf0bb569cfc2db90bf4e311906c Mon Sep 17 00:00:00 2001 From: juliannguyen4 <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 18 Oct 2023 19:19:39 +0000 Subject: [PATCH] Fix mem error --- src/main/policy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/policy.c b/src/main/policy.c index 745eaa35bb..6f706c3eb8 100644 --- a/src/main/policy.c +++ b/src/main/policy.c @@ -1160,9 +1160,9 @@ as_status pyobject_to_map_policy(as_error *err, PyObject *py_policy, // persist_index value must be valid if it is set return as_error_update(err, AEROSPIKE_ERR_PARAM, "persist_index is not a boolean"); + }else{ + persist_index = (bool)PyObject_IsTrue(py_persist_index); } - - persist_index = (bool)PyObject_IsTrue(py_persist_index); as_map_policy_set_all(policy, map_order, map_write_mode, persist_index); return err->code;