]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
added patch from kurt that fixes memory leak (didn't free line buffer
authorJulian Assange <proff@suburbia.net>
Tue, 6 Aug 1996 00:40:12 +0000 (00:40 +0000)
committerJulian Assange <proff@suburbia.net>
Tue, 6 Aug 1996 00:40:12 +0000 (00:40 +0000)
for slash commands)

src/bin/psql/psql.c

index c65d83cc7ced3130f2f82f237289c96bf62491d8..6ab76ecebca9bdc2d61943cbccb1b2331fe2b5b5 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.15 1996/07/31 02:11:23 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.16 1996/08/06 00:40:12 julian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1064,10 +1064,14 @@ MainLoop(PsqlSettings *settings, FILE *source)
          slashCmdStatus = HandleSlashCmds(settings,
                                           line, 
                                           query);
-       if (slashCmdStatus == 1)
+       if (slashCmdStatus == 1) {
+         free(line);
          continue;
-       if (slashCmdStatus == 2)
+       }
+       if (slashCmdStatus == 2) {
+         free(line);
          break;
+       }
        if (slashCmdStatus == 0)
          sendQuery = 1;
       }