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
17bab8c3
Commit
17bab8c3
authored
Jun 25, 2006
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved some free() calls that coverity correctly complains about.
parent
885a4d3d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
9 deletions
+19
-9
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+4
-0
src/interfaces/ecpg/ecpglib/descriptor.c
src/interfaces/ecpg/ecpglib/descriptor.c
+2
-2
src/interfaces/ecpg/ecpglib/execute.c
src/interfaces/ecpg/ecpglib/execute.c
+12
-6
src/interfaces/ecpg/test/test_init.pgc
src/interfaces/ecpg/test/test_init.pgc
+1
-1
No files found.
src/interfaces/ecpg/ChangeLog
View file @
17bab8c3
...
...
@@ -2026,5 +2026,9 @@ we Jun 21 13:37:00 CEST 2006
- Added some more coverity report patches send in by Martijn van
Oosterhout <kleptog@svana.org>.
Su Jun 25 11:27:46 CEST 2006
- Moved some free() calls that coverity correctly complains about.
- Set ecpg library version to 5.2.
- Set ecpg version to 4.2.1.
src/interfaces/ecpg/ecpglib/descriptor.c
View file @
17bab8c3
/* dynamic SQL support routines
*
* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.1
5 2006/06/21 10:24:40
meskes Exp $
* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.1
6 2006/06/25 09:38:39
meskes Exp $
*/
#define POSTGRES_ECPG_INTERNAL
...
...
@@ -349,7 +349,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
return
false
;
}
/* allocate storage if needed */
if
(
arrsize
==
0
&&
var
!=
NULL
&&
*
(
void
**
)
var
==
NULL
)
if
(
arrsize
==
0
&&
*
(
void
**
)
var
==
NULL
)
{
void
*
mem
=
(
void
*
)
ECPGalloc
(
offset
*
ntuples
,
lineno
);
if
(
!
mem
)
...
...
src/interfaces/ecpg/ecpglib/execute.c
View file @
17bab8c3
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.4
8 2006/06/21 11:38:07
meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.4
9 2006/06/25 09:38:39
meskes Exp $ */
/*
* The aim is to get a simpler inteface to the database routines.
...
...
@@ -896,7 +896,7 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
if
(
!
(
mallocedval
=
ECPGrealloc
(
mallocedval
,
strlen
(
mallocedval
)
+
slen
+
sizeof
(
"array [] "
),
lineno
)))
{
PGTYPESnumeric_free
(
nval
);
free
(
str
);
ECPG
free
(
str
);
return
false
;
}
...
...
@@ -905,8 +905,9 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
strncpy
(
mallocedval
+
strlen
(
mallocedval
),
str
,
slen
+
1
);
strcpy
(
mallocedval
+
strlen
(
mallocedval
),
","
);
ECPGfree
(
str
);
PGTYPESnumeric_free
(
nval
);
}
PGTYPESnumeric_free
(
nval
);
strcpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"]"
);
}
else
...
...
@@ -929,12 +930,12 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
strncpy
(
mallocedval
,
str
,
slen
);
mallocedval
[
slen
]
=
'\0'
;
ECPGfree
(
str
);
PGTYPESnumeric_free
(
nval
);
}
*
tobeinserted_p
=
mallocedval
;
*
malloced_p
=
true
;
PGTYPESnumeric_free
(
nval
);
free
(
str
);
}
break
;
...
...
@@ -964,6 +965,7 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
strcpy
(
mallocedval
+
strlen
(
mallocedval
),
"interval "
);
strncpy
(
mallocedval
+
strlen
(
mallocedval
),
str
,
slen
+
1
);
strcpy
(
mallocedval
+
strlen
(
mallocedval
),
","
);
ECPGfree
(
str
);
}
strcpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"]"
);
}
...
...
@@ -983,11 +985,11 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
strcpy
(
mallocedval
,
"interval "
);
/* also copy trailing '\0' */
strncpy
(
mallocedval
+
strlen
(
mallocedval
),
str
,
slen
+
1
);
ECPGfree
(
str
);
}
*
tobeinserted_p
=
mallocedval
;
*
malloced_p
=
true
;
ECPGfree
(
str
);
}
break
;
...
...
@@ -1163,6 +1165,7 @@ ECPGexecute(struct statement * stmt)
if
(
desc
==
NULL
)
{
ECPGraise
(
stmt
->
lineno
,
ECPG_UNKNOWN_DESCRIPTOR
,
ECPG_SQLSTATE_INVALID_SQL_DESCRIPTOR_NAME
,
var
->
pointer
);
ECPGfree
(
copiedquery
);
return
false
;
}
...
...
@@ -1194,7 +1197,10 @@ ECPGexecute(struct statement * stmt)
desc_inlist
.
ind_offset
=
0
;
}
if
(
!
ECPGstore_input
(
stmt
->
lineno
,
stmt
->
force_indicator
,
&
desc_inlist
,
&
tobeinserted
,
&
malloced
))
{
ECPGfree
(
copiedquery
);
return
false
;
}
break
;
}
...
...
src/interfaces/ecpg/test/test_init.pgc
View file @
17bab8c3
...
...
@@ -23,7 +23,7 @@ namespace N
#endif
int main(void)
{ struct sa x,*y;
{ struct sa x,*y
=&x
;
exec sql begin declare section;
int a=(int)2;
int b=2+2;
...
...
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