summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2011-11-25 13:53:48 +1100
committerDamien Miller <djm@mindrot.org>2011-11-25 13:53:48 +1100
commit47d8115e5347385d55b4a17b026bd131793b9e95 (patch)
tree8539a557d55fbd63a09406711cad8cf365d35d0e /sftp.c
parent4a725ef6a54d527fa5f2b3ab56dfff67e372ccdd (diff)
downloadopenssh-git-47d8115e5347385d55b4a17b026bd131793b9e95.tar.gz
- 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@
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sftp.c b/sftp.c
index 5c03f89d..da7fbab3 100644
--- 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);