Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
2ddada56
Commit
2ddada56
authored
Dec 10, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed memory leak that occurs when getting positions.
parent
2c19d5db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
lib/python/SearchIndex/Splitter.c
lib/python/SearchIndex/Splitter.c
+12
-5
No files found.
lib/python/SearchIndex/Splitter.c
View file @
2ddada56
...
...
@@ -268,7 +268,13 @@ Splitter_pos(Splitter *self, PyObject *args)
while
(
self
->
index
<
i
)
{
UNLESS
(
res
=
next_word
(
self
,
&
start
,
&
end
))
return
NULL
;
if
(
PyString_Check
(
res
))
continue
;
if
(
PyString_Check
(
res
))
{
self
->
index
++
;
Py_DECREF
(
res
);
continue
;
}
Py_DECREF
(
res
);
PyErr_SetString
(
PyExc_IndexError
,
"Splitter index out of range"
);
return
NULL
;
}
...
...
@@ -280,7 +286,7 @@ Splitter_pos(Splitter *self, PyObject *args)
static
PyObject
*
Splitter_indexes
(
Splitter
*
self
,
PyObject
*
args
)
{
PyObject
*
word
,
*
r
,
*
w
,
*
index
=
0
;
PyObject
*
word
,
*
r
,
*
w
=
0
,
*
index
=
0
;
int
i
=
0
;
UNLESS
(
PyArg_ParseTuple
(
args
,
"O"
,
&
word
))
return
NULL
;
...
...
@@ -290,7 +296,7 @@ Splitter_indexes(Splitter *self, PyObject *args)
Splitter_reset
(
self
);
while
(
1
)
{
UNLESS
(
w
=
next_word
(
self
,
NULL
,
NULL
))
goto
err
;
UNLESS
_ASSIGN
(
w
=
next_word
(
self
,
NULL
,
NULL
))
goto
err
;
UNLESS
(
PyString_Check
(
w
))
break
;
if
(
PyObject_Compare
(
word
,
w
)
==
0
)
{
...
...
@@ -299,6 +305,7 @@ Splitter_indexes(Splitter *self, PyObject *args)
}
i
++
;
}
Py_XDECREF
(
w
);
Py_XDECREF
(
index
);
return
r
;
...
...
@@ -388,14 +395,14 @@ static char Splitter_module_documentation[] =
"
\n
"
"for use in an inverted index
\n
"
"
\n
"
"$Id: Splitter.c,v 1.
3 1997/11/13 20:38:38
jim Exp $
\n
"
"$Id: Splitter.c,v 1.
4 1997/12/10 20:47:47
jim Exp $
\n
"
;
void
initSplitter
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.
3
$"
;
char
*
rev
=
"$Revision: 1.
4
$"
;
/* Create the module and add the functions */
m
=
Py_InitModule4
(
"Splitter"
,
Splitter_module_methods
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment