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
96ad72d1
Commit
96ad72d1
authored
Jun 12, 2015
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some memory leaks in ECPG.
Patch by Michael Paquier
parent
82be1bf5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
src/interfaces/ecpg/preproc/descriptor.c
src/interfaces/ecpg/preproc/descriptor.c
+9
-3
src/interfaces/ecpg/preproc/pgc.l
src/interfaces/ecpg/preproc/pgc.l
+3
-1
src/interfaces/ecpg/preproc/variable.c
src/interfaces/ecpg/preproc/variable.c
+3
-1
No files found.
src/interfaces/ecpg/preproc/descriptor.c
View file @
96ad72d1
...
...
@@ -175,6 +175,7 @@ output_get_descr(char *desc_name, char *index)
for
(
results
=
assignments
;
results
!=
NULL
;
results
=
results
->
next
)
{
const
struct
variable
*
v
=
find_variable
(
results
->
variable
);
char
*
str_zero
=
mm_strdup
(
"0"
);
switch
(
results
->
value
)
{
...
...
@@ -188,7 +189,8 @@ output_get_descr(char *desc_name, char *index)
break
;
}
fprintf
(
yyout
,
"%s,"
,
get_dtype
(
results
->
value
));
ECPGdump_a_type
(
yyout
,
v
->
name
,
v
->
type
,
v
->
brace_level
,
NULL
,
NULL
,
-
1
,
NULL
,
NULL
,
mm_strdup
(
"0"
),
NULL
,
NULL
);
ECPGdump_a_type
(
yyout
,
v
->
name
,
v
->
type
,
v
->
brace_level
,
NULL
,
NULL
,
-
1
,
NULL
,
NULL
,
str_zero
,
NULL
,
NULL
);
free
(
str_zero
);
}
drop_assignments
();
fputs
(
"ECPGd_EODT);
\n
"
,
yyout
);
...
...
@@ -292,8 +294,12 @@ output_set_descr(char *desc_name, char *index)
case
ECPGd_indicator
:
case
ECPGd_length
:
case
ECPGd_type
:
fprintf
(
yyout
,
"%s,"
,
get_dtype
(
results
->
value
));
ECPGdump_a_type
(
yyout
,
v
->
name
,
v
->
type
,
v
->
brace_level
,
NULL
,
NULL
,
-
1
,
NULL
,
NULL
,
mm_strdup
(
"0"
),
NULL
,
NULL
);
{
char
*
str_zero
=
mm_strdup
(
"0"
);
fprintf
(
yyout
,
"%s,"
,
get_dtype
(
results
->
value
));
ECPGdump_a_type
(
yyout
,
v
->
name
,
v
->
type
,
v
->
brace_level
,
NULL
,
NULL
,
-
1
,
NULL
,
NULL
,
str_zero
,
NULL
,
NULL
);
free
(
str_zero
);
}
break
;
default:
...
...
src/interfaces/ecpg/preproc/pgc.l
View file @
96ad72d1
...
...
@@ -27,7 +27,7 @@
extern YYSTYPE yylval;
static int xcdepth = 0; /* depth of nesting in slash-star comments */
static char *dolqstart
;
/* current $foo$ quote start string */
static char *dolqstart
= NULL;
/* current $foo$ quote start string */
static YY_BUFFER_STATE scanbufhandle;
static char *scanbuf;
...
...
@@ -550,6 +550,8 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
}
<SQL>{dolqdelim} {
token_start = yytext;
if (dolqstart)
free(dolqstart);
dolqstart = mm_strdup(yytext);
BEGIN(xdolq);
startlit();
...
...
src/interfaces/ecpg/preproc/variable.c
View file @
96ad72d1
...
...
@@ -437,11 +437,13 @@ remove_variable_from_list(struct arguments ** list, struct variable * var)
void
dump_variables
(
struct
arguments
*
list
,
int
mode
)
{
char
*
str_zero
=
mm_strdup
(
"0"
)
;
char
*
str_zero
;
if
(
list
==
NULL
)
return
;
str_zero
=
mm_strdup
(
"0"
);
/*
* The list is build up from the beginning so lets first dump the end of
* the list:
...
...
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