Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 790fa1f

Browse files
committed
Fix memory leak in tab completion.
This was introduced in commit e49ad77. Fixed in another, more future-proof way in HEAD.
1 parent 13a8678 commit 790fa1f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/psql/tab-complete.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ psql_completion(char *text, int start, int end)
755755
completion_info_charp2 = NULL;
756756

757757
/*
758-
* Scan the input line before our current position for the last five
758+
* Scan the input line before our current position for the last six
759759
* words. According to those we'll make some smart decisions on what the
760760
* user is probably intending to type. TODO: Use strtokx() to do this.
761761
*/
@@ -2922,6 +2922,7 @@ psql_completion(char *text, int start, int end)
29222922
free(prev3_wd);
29232923
free(prev4_wd);
29242924
free(prev5_wd);
2925+
free(prev6_wd);
29252926

29262927
/* Return our Grand List O' Matches */
29272928
return matches;

0 commit comments

Comments
 (0)