]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- oga@cvs.openbsd.org 2011/11/16 12:24:28
authorDamien Miller <djm@mindrot.org>
Fri, 25 Nov 2011 02:53:48 +0000 (13:53 +1100)
committerDamien Miller <djm@mindrot.org>
Fri, 25 Nov 2011 02:53:48 +0000 (13:53 +1100)
     [sftp.c]
     Don't leak list in complete_cmd_parse if there are no commands found.
     Discovered when I was ``borrowing'' this code for something else.
     ok djm@

ChangeLog
sftp.c

index d55a397bf524287ec3d19e70d397b8ca6474094f..760772d5965c0f4650954e9ec2f80bf3ac503a41 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+20111125
+ - OpenBSD CVS Sync
+   - oga@cvs.openbsd.org 2011/11/16 12:24:28
+     [sftp.c]
+     Don't leak list in complete_cmd_parse if there are no commands found.
+     Discovered when I was ``borrowing'' this code for something else.
+     ok djm@
+
 20111121
  - (dtucker) [configure.ac] Set _FORTIFY_SOURCE.  ok djm@
 
diff --git a/sftp.c b/sftp.c
index 5c03f89d799a408ff5100abc1b43f363af8b38d0..da7fbab38e0530cf5d050d1a6b438b841e48a22f 100644 (file)
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.133 2011/09/22 06:29:03 djm Exp $ */
+/* $OpenBSD: sftp.c,v 1.134 2011/11/16 12:24:28 oga Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
  *
@@ -1631,8 +1631,10 @@ complete_cmd_parse(EditLine *el, char *cmd, int lastarg, char quote,
        }
        list[count] = NULL;
 
-       if (count == 0)
+       if (count == 0) {
+               xfree(list);
                return 0;
+       }
 
        /* Complete ambigious command */
        tmp = complete_ambiguous(cmd, list, count);