Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d8adce89
Commit
d8adce89
authored
Jun 01, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for malloc failure.
parent
25ee08e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
src/backend/commands/sequence.c
src/backend/commands/sequence.c
+6
-3
src/backend/lib/dllist.c
src/backend/lib/dllist.c
+5
-1
No files found.
src/backend/commands/sequence.c
View file @
d8adce89
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.5
6 2001/05/27 09:59:29 petere
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.5
7 2001/06/01 19:52:24 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -646,8 +646,11 @@ init_sequence(char *caller, char *name)
* as the backend does, so we use plain malloc for them.
*/
elm
=
(
SeqTable
)
malloc
(
sizeof
(
SeqTableData
));
elm
->
name
=
malloc
(
strlen
(
name
)
+
1
);
strcpy
(
elm
->
name
,
name
);
if
(
elm
==
NULL
)
elog
(
ERROR
,
"Memory exhausted in init_sequence"
);
elm
->
name
=
strdup
(
name
);
if
(
elm
->
name
==
NULL
)
elog
(
ERROR
,
"Memory exhausted in init_sequence"
);
elm
->
rel
=
seqrel
;
elm
->
relid
=
RelationGetRelid
(
seqrel
);
elm
->
cached
=
elm
->
last
=
elm
->
increment
=
0
;
...
...
src/backend/lib/dllist.c
View file @
d8adce89
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.2
1 2001/02/10 02:31:26
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.2
2 2001/06/01 19:54:58
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -32,6 +32,8 @@ DLNewList(void)
Dllist
*
l
;
l
=
(
Dllist
*
)
malloc
(
sizeof
(
Dllist
));
if
(
l
==
NULL
)
elog
(
ERROR
,
"Memory exhausted in DLNewList"
);
l
->
dll_head
=
0
;
l
->
dll_tail
=
0
;
...
...
@@ -66,6 +68,8 @@ DLNewElem(void *val)
Dlelem
*
e
;
e
=
(
Dlelem
*
)
malloc
(
sizeof
(
Dlelem
));
if
(
e
==
NULL
)
elog
(
ERROR
,
"Memory exhausted in DLNewElem"
);
e
->
dle_next
=
0
;
e
->
dle_prev
=
0
;
e
->
dle_val
=
val
;
...
...
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