Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1673122

Browse files
committed
psql: Fix memory leak
In expanded auto mode, a lot of allocated memory was not cleaned up. found by Coverity
1 parent 561ec76 commit 1673122

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/psql/print.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
735735
(output_columns < total_header_width || output_columns < width_total))
736736
{
737737
print_aligned_vertical(cont, fout);
738-
return;
738+
goto cleanup;
739739
}
740740

741741
/* If we wrapped beyond the display width, use the pager */
@@ -1050,6 +1050,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
10501050
fputc('\n', fout);
10511051
}
10521052

1053+
cleanup:
10531054
/* clean up */
10541055
for (i = 0; i < col_count; i++)
10551056
{

0 commit comments

Comments
 (0)