Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Nov 2012 23:06:42 +0000 (UTC)
From:      Tom Judge <tj@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r307573 - in branches/RELENG_9_1_0/devel/libcli: . files
Message-ID:  <201211192306.qAJN6g76059776@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tj
Date: Mon Nov 19 23:06:42 2012
New Revision: 307573
URL: http://svnweb.freebsd.org/changeset/ports/307573

Log:
  MFH r307299:
  
  * Fix memory leak
  * Take over maintainer
  
  Feature safe:	yes
  Approved by:	bapt
  Approved by:	portmgr (beat)
  Approved by:	eadler, db (mentors, implicit)

Added:
  branches/RELENG_9_1_0/devel/libcli/files/patch-libcli.c
     - copied unchanged from r307299, head/devel/libcli/files/patch-libcli.c
Modified:
  branches/RELENG_9_1_0/devel/libcli/Makefile   (contents, props changed)
Directory Properties:
  branches/RELENG_9_1_0/   (props changed)

Modified: branches/RELENG_9_1_0/devel/libcli/Makefile
==============================================================================
--- branches/RELENG_9_1_0/devel/libcli/Makefile	Mon Nov 19 21:25:47 2012	(r307572)
+++ branches/RELENG_9_1_0/devel/libcli/Makefile	Mon Nov 19 23:06:42 2012	(r307573)
@@ -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

Copied: branches/RELENG_9_1_0/devel/libcli/files/patch-libcli.c (from r307299, head/devel/libcli/files/patch-libcli.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/RELENG_9_1_0/devel/libcli/files/patch-libcli.c	Mon Nov 19 23:06:42 2012	(r307573, copy of r307299, head/devel/libcli/files/patch-libcli.c)
@@ -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
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211192306.qAJN6g76059776>