File tree 2 files changed +11
-4
lines changed 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.56 2001/05/27 09:59:29 petere Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.57 2001/06/01 19:52:24 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -646,8 +646,11 @@ init_sequence(char *caller, char *name)
646
646
* as the backend does, so we use plain malloc for them.
647
647
*/
648
648
elm = (SeqTable ) malloc (sizeof (SeqTableData ));
649
- elm -> name = malloc (strlen (name ) + 1 );
650
- strcpy (elm -> name , name );
649
+ if (elm == NULL )
650
+ elog (ERROR , "Memory exhausted in init_sequence" );
651
+ elm -> name = strdup (name );
652
+ if (elm -> name == NULL )
653
+ elog (ERROR , "Memory exhausted in init_sequence" );
651
654
elm -> rel = seqrel ;
652
655
elm -> relid = RelationGetRelid (seqrel );
653
656
elm -> cached = elm -> last = elm -> increment = 0 ;
Original file line number Diff line number Diff line change 9
9
*
10
10
*
11
11
* IDENTIFICATION
12
- * $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.21 2001/02/10 02:31:26 tgl Exp $
12
+ * $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.22 2001/06/01 19:54:58 tgl Exp $
13
13
*
14
14
*-------------------------------------------------------------------------
15
15
*/
@@ -32,6 +32,8 @@ DLNewList(void)
32
32
Dllist * l ;
33
33
34
34
l = (Dllist * ) malloc (sizeof (Dllist ));
35
+ if (l == NULL )
36
+ elog (ERROR , "Memory exhausted in DLNewList" );
35
37
l -> dll_head = 0 ;
36
38
l -> dll_tail = 0 ;
37
39
@@ -66,6 +68,8 @@ DLNewElem(void *val)
66
68
Dlelem * e ;
67
69
68
70
e = (Dlelem * ) malloc (sizeof (Dlelem ));
71
+ if (e == NULL )
72
+ elog (ERROR , "Memory exhausted in DLNewElem" );
69
73
e -> dle_next = 0 ;
70
74
e -> dle_prev = 0 ;
71
75
e -> dle_val = val ;
You can’t perform that action at this time.
0 commit comments