We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 836fd9e commit 0dd0ed3Copy full SHA for 0dd0ed3
yara-python.c
@@ -1884,6 +1884,7 @@ static void StringMatchInstance_dealloc(
1884
1885
Py_DECREF(object->offset);
1886
Py_DECREF(object->matched_data);
1887
+ Py_DECREF(object->matched_length);
1888
Py_DECREF(object->xor_key);
1889
1890
PyObject_Del(self);
@@ -1923,7 +1924,10 @@ static PyObject* StringMatchInstance_plaintext(
1923
1924
StringMatchInstance* instance = (StringMatchInstance*) self;
1925
uint64_t xor_key = PyLong_AsUnsignedLongLong(instance->xor_key);
1926
if (xor_key == 0)
1927
+ {
1928
+ Py_INCREF(instance->matched_data);
1929
return instance->matched_data;
1930
+ }
1931
1932
int result = PyBytes_AsStringAndSize(instance->matched_data, &pb, &length);
1933
if (result == -1)
0 commit comments