Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6910032

Browse files
author
Neil Conway
committed
Upon closer inspection, Greg's psql tab completion patch leaks memory.
Fix the leak, and add a comment to note that the return value ofprevious_word must be free'd.
1 parent4c1f9a0 commit6910032

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎src/bin/psql/tab-complete.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.128 2005/05/1804:47:40 neilc Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.129 2005/05/1805:01:10 neilc Exp $
77
*/
88

99
/*----------------------------------------------------------------------
@@ -1802,6 +1802,7 @@ psql_completion(char *text, int start, int end)
18021802
free(prev2_wd);
18031803
free(prev3_wd);
18041804
free(prev4_wd);
1805+
free(prev5_wd);
18051806

18061807
/* Return our Grand List O' Matches */
18071808
returnmatches;
@@ -2168,9 +2169,11 @@ exec_query(const char *query)
21682169

21692170

21702171

2171-
/* Return the word (space delimited) before point. Set skip > 0 to skip that
2172-
many words; e.g. skip=1 finds the word before the previous one.
2173-
*/
2172+
/*
2173+
* Return the word (space delimited) before point. Set skip > 0 to
2174+
* skip that many words; e.g. skip=1 finds the word before the
2175+
* previous one. Return value is NULL or a malloc'ed string.
2176+
*/
21742177
staticchar*
21752178
previous_word(intpoint,intskip)
21762179
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp