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
df3f152e
Commit
df3f152e
authored
Jun 13, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't assume free(NULL) is OK. Yes, I know ANSI C says it is.
parent
c74dc128
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
src/backend/utils/init/miscinit.c
src/backend/utils/init/miscinit.c
+14
-6
No files found.
src/backend/utils/init/miscinit.c
View file @
df3f152e
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.
69 2001/06/06 17:07:46
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.
70 2001/06/13 19:52:33
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -36,7 +36,6 @@
#ifdef CYR_RECODE
unsigned
char
RecodeForwTable
[
128
];
unsigned
char
RecodeBackTable
[
128
];
#endif
ProcessingMode
Mode
=
InitProcessing
;
...
...
@@ -82,7 +81,11 @@ IgnoreSystemIndexes(bool mode)
void
SetDatabasePath
(
const
char
*
path
)
{
free
(
DatabasePath
);
if
(
DatabasePath
)
{
free
(
DatabasePath
);
DatabasePath
=
NULL
;
}
/* use strdup since this is done before memory contexts are set up */
if
(
path
)
{
...
...
@@ -94,7 +97,12 @@ SetDatabasePath(const char *path)
void
SetDatabaseName
(
const
char
*
name
)
{
free
(
DatabaseName
);
if
(
DatabaseName
)
{
free
(
DatabaseName
);
DatabaseName
=
NULL
;
}
/* use strdup since this is done before memory contexts are set up */
if
(
name
)
{
DatabaseName
=
strdup
(
name
);
...
...
@@ -112,8 +120,6 @@ SetDataDir(const char *dir)
char
*
new
;
AssertArg
(
dir
);
if
(
DataDir
)
free
(
DataDir
);
if
(
dir
[
0
]
!=
'/'
)
{
...
...
@@ -155,6 +161,8 @@ SetDataDir(const char *dir)
elog
(
FATAL
,
"out of memory"
);
}
if
(
DataDir
)
free
(
DataDir
);
DataDir
=
new
;
}
...
...
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