From owner-svn-ports-all@FreeBSD.ORG Sat Nov 10 18:26:37 2012 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA318457; Sat, 10 Nov 2012 18:26:36 +0000 (UTC) (envelope-from tj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C64BD8FC08; Sat, 10 Nov 2012 18:26:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAIQa4a080135; Sat, 10 Nov 2012 18:26:36 GMT (envelope-from tj@svn.freebsd.org) Received: (from tj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAIQanL080132; Sat, 10 Nov 2012 18:26:36 GMT (envelope-from tj@svn.freebsd.org) Message-Id: <201211101826.qAAIQanL080132@svn.freebsd.org> From: Tom Judge Date: Sat, 10 Nov 2012 18:26:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r307299 - in head/devel/libcli: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 18:26:37 -0000 Author: tj Date: Sat Nov 10 18:26:36 2012 New Revision: 307299 URL: http://svnweb.freebsd.org/changeset/ports/307299 Log: * Fix memory leak * Take over maintainer Feature safe: yes Approved by: bapt Approved by: eadler (mentor) Added: head/devel/libcli/files/patch-libcli.c (contents, props changed) Modified: head/devel/libcli/Makefile (contents, props changed) Modified: head/devel/libcli/Makefile ============================================================================== --- head/devel/libcli/Makefile Sat Nov 10 18:16:38 2012 (r307298) +++ head/devel/libcli/Makefile Sat Nov 10 18:26:36 2012 (r307299) @@ -2,10 +2,11 @@ PORTNAME= libcli PORTVERSION= 1.9.6 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= http://cloud.github.com/downloads/dparrish/libcli/ -MAINTAINER= bapt@FreeBSD.org +MAINTAINER= tj@FreeBSD.org COMMENT= Emulates a Cisco style command-line interface LICENSE= LGPL21 Added: head/devel/libcli/files/patch-libcli.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libcli/files/patch-libcli.c Sat Nov 10 18:26:36 2012 (r307299) @@ -0,0 +1,60 @@ +diff --git a/libcli.c b/libcli.c +index de6e2e9..59dd42f 100644 +--- libcli.c ++++ libcli.c +@@ -1017,7 +1017,7 @@ static int cli_get_completions(struct cli_def *cli, const char *command, char ** + { + struct cli_command *c; + struct cli_command *n; +- int num_words, i, k=0; ++ int num_words, save_words, i, k=0; + char *words[CLI_MAX_LINE_WORDS] = {0}; + int filter = 0; + +@@ -1025,12 +1025,12 @@ static int cli_get_completions(struct cli_def *cli, const char *command, char ** + while (isspace(*command)) + command++; + +- num_words = cli_parse_line(command, words, sizeof(words)/sizeof(words[0])); ++ save_words = num_words = cli_parse_line(command, words, sizeof(words)/sizeof(words[0])); + if (!command[0] || command[strlen(command)-1] == ' ') + num_words++; + + if (!num_words) +- return 0; ++ goto out; + + for (i = 0; i < num_words; i++) + { +@@ -1043,7 +1043,7 @@ static int cli_get_completions(struct cli_def *cli, const char *command, char ** + unsigned len = 0; + + if (filter < num_words - 1) // filter already completed +- return 0; ++ goto out; + + if (filter == num_words - 1) + len = strlen(words[num_words-1]); +@@ -1055,7 +1055,7 @@ static int cli_get_completions(struct cli_def *cli, const char *command, char ** + } + + completions[k] = NULL; +- return k; ++ goto out; + } + + for (c = cli->commands, i = 0; c && i < num_words && k < max_completions; c = n) +@@ -1084,6 +1084,10 @@ static int cli_get_completions(struct cli_def *cli, const char *command, char ** + completions[k++] = c->command; + } + ++out: ++ for (i = 0; i < save_words; i++) ++ free(words[i]); ++ + return k; + } + +-- +1.7.10 +