Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Nicolas Wavrant
ZODB
Commits
0b3504cd
Commit
0b3504cd
authored
Jun 17, 2002
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bucket_grow(): This could leak memory in error cases; repaired.
parent
9e57fe53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
src/BTrees/BucketTemplate.c
src/BTrees/BucketTemplate.c
+14
-6
No files found.
src/BTrees/BucketTemplate.c
View file @
0b3504cd
...
...
@@ -12,7 +12,7 @@
****************************************************************************/
#define BUCKETTEMPLATE_C "$Id: BucketTemplate.c,v 1.4
1 2002/06/13 19:19:41
tim_one Exp $\n"
#define BUCKETTEMPLATE_C "$Id: BucketTemplate.c,v 1.4
2 2002/06/17 19:03:55
tim_one Exp $\n"
/* Use BUCKET_SEARCH to find the index at which a key belongs.
* INDEX An int lvalue to hold the index i such that KEY belongs at
...
...
@@ -140,9 +140,12 @@ Bucket_grow(Bucket *self, int newsize, int noval)
UNLESS
(
noval
)
{
UNLESS
(
values
=
PyRealloc
(
self
->
values
,
sizeof
(
VALUE_TYPE
)
*
newsize
))
return
-
1
;
values
=
PyRealloc
(
self
->
values
,
sizeof
(
VALUE_TYPE
)
*
newsize
);
if
(
values
==
NULL
)
{
free
(
keys
);
return
-
1
;
}
self
->
values
=
values
;
}
self
->
keys
=
keys
;
...
...
@@ -155,8 +158,13 @@ Bucket_grow(Bucket *self, int newsize, int noval)
return
-
1
;
UNLESS
(
noval
)
{
UNLESS
(
self
->
values
=
PyMalloc
(
sizeof
(
VALUE_TYPE
)
*
newsize
))
return
-
1
;
self
->
values
=
PyMalloc
(
sizeof
(
VALUE_TYPE
)
*
newsize
);
if
(
self
->
values
==
NULL
)
{
free
(
self
->
keys
);
self
->
keys
=
NULL
;
return
-
1
;
}
}
}
self
->
size
=
newsize
;
...
...
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