[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@
+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@
-/* $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>
*
}
list[count] = NULL;
- if (count == 0)
+ if (count == 0) {
+ xfree(list);
return 0;
+ }
/* Complete ambigious command */
tmp = complete_ambiguous(cmd, list, count);