Skip to content

Commit

Permalink
Merge pull request #25 from siavash119/patch-1
Browse files Browse the repository at this point in the history
Fix reply map value memory leak
  • Loading branch information
mkmkme authored Nov 7, 2024
2 parents a85254f + 06ccd5b commit 898c3c8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ static void *tryParentize(const valkeyReadTask *task, PyObject *obj) {
Py_DECREF(obj);
return NULL;
}
if (PyDict_SetItem(parent, self->pendingObject, obj) < 0) {
Py_DECREF(obj);
Py_DECREF(self->pendingObject);
self->pendingObject = NULL;
int x = PyDict_SetItem(parent, self->pendingObject, obj);
Py_DECREF(obj);
Py_DECREF(self->pendingObject);
self->pendingObject = NULL;
if (x < 0) {
return NULL;
}
self->pendingObject = NULL;
}
break;
case VALKEY_REPLY_SET:
Expand Down

0 comments on commit 898c3c8

Please sign in to comment.