Skip to content

Commit

Permalink
Fix mem leak
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Sep 27, 2024
1 parent c0cd51b commit 0f159c5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@

#define POLICY_SET_EXPRESSIONS_FIELD() \
{ \
PyObject *py_field_name = PyUnicode_FromString("expressions"); \
if (py_field_name == NULL) { \
PyErr_Clear(); \
return as_error_update(err, AEROSPIKE_ERR_CLIENT, \
"Unable to create Python unicode object"); \
} \
if (exp_list) { \
PyObject *py_field_name = PyUnicode_FromString("expressions"); \
if (py_field_name == NULL) { \
PyErr_Clear(); \
return as_error_update( \
err, AEROSPIKE_ERR_CLIENT, \
"Unable to create Python unicode object"); \
} \
PyObject *py_exp_list = \
PyDict_GetItemWithError(py_policy, py_field_name); \
Py_DECREF(py_field_name); \
Expand Down

0 comments on commit 0f159c5

Please sign in to comment.