mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Fixed a memory leak in the cache module.
This commit is contained in:
parent
cea1ec7641
commit
e41457913f
7
core_pe/modules/cache/cache.c
vendored
7
core_pe/modules/cache/cache.c
vendored
@ -33,6 +33,7 @@ cache_string_to_colors(PyObject *self, PyObject *args)
|
||||
char *s;
|
||||
Py_ssize_t char_count, color_count, i;
|
||||
PyObject *result;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s#", &s, &char_count)) {
|
||||
return NULL;
|
||||
}
|
||||
@ -62,10 +63,10 @@ cache_string_to_colors(PyObject *self, PyObject *args)
|
||||
return NULL;
|
||||
}
|
||||
color_tuple = PyTuple_Pack(3, pr, pg, pb);
|
||||
Py_DECREF(pr);
|
||||
Py_DECREF(pg);
|
||||
Py_DECREF(pb);
|
||||
if (color_tuple == NULL) {
|
||||
Py_DECREF(pr);
|
||||
Py_DECREF(pg);
|
||||
Py_DECREF(pb);
|
||||
Py_DECREF(result);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user