Skip to content

Commit 7ef04b2

Browse files
author
Julian Assange
committed
added patch from kurt that fixes memory leak (didn't free line buffer
for slash commands)
1 parent 132e915 commit 7ef04b2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/bin/psql/psql.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.15 1996/07/31 02:11:23 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.16 1996/08/06 00:40:12 julian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1064,10 +1064,14 @@ MainLoop(PsqlSettings *settings, FILE *source)
10641064
slashCmdStatus = HandleSlashCmds(settings,
10651065
line,
10661066
query);
1067-
if (slashCmdStatus == 1)
1067+
if (slashCmdStatus == 1) {
1068+
free(line);
10681069
continue;
1069-
if (slashCmdStatus == 2)
1070+
}
1071+
if (slashCmdStatus == 2) {
1072+
free(line);
10701073
break;
1074+
}
10711075
if (slashCmdStatus == 0)
10721076
sendQuery = 1;
10731077
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy