projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
561ec76
)
psql: Fix memory leak
author
Peter Eisentraut
Wed, 7 Mar 2012 21:52:15 +0000
(23:52 +0200)
committer
Peter Eisentraut
Wed, 7 Mar 2012 21:52:15 +0000
(23:52 +0200)
In expanded auto mode, a lot of allocated memory was not cleaned up.
found by Coverity
src/bin/psql/print.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/psql/print.c
b/src/bin/psql/print.c
index 594a63acfd240ef03c8ab7a442209031d870e429..f7b5e808894c13a13d55f32a679802a103a353cf 100644
(file)
--- a/
src/bin/psql/print.c
+++ b/
src/bin/psql/print.c
@@
-735,7
+735,7
@@
print_aligned_text(const printTableContent *cont, FILE *fout)
(output_columns < total_header_width || output_columns < width_total))
{
print_aligned_vertical(cont, fout);
-
return
;
+
goto cleanup
;
}
/* If we wrapped beyond the display width, use the pager */
@@
-1050,6
+1050,7
@@
print_aligned_text(const printTableContent *cont, FILE *fout)
fputc('\n', fout);
}
+cleanup:
/* clean up */
for (i = 0; i < col_count; i++)
{