[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[giFTcurs-commits] giFTcurs/src parse.c
From: |
Christian Häggström |
Subject: |
[giFTcurs-commits] giFTcurs/src parse.c |
Date: |
Mon, 15 Sep 2003 17:24:37 -0400 |
CVSROOT: /cvsroot/giftcurs
Module name: giFTcurs
Branch:
Changes by: Christian Häggström <address@hidden> 03/09/15 17:24:37
Modified files:
src : parse.c
Log message:
fix memory leak on protocol: parsing
Patches:
Index: giFTcurs/src/parse.c
diff -u giFTcurs/src/parse.c:1.146 giFTcurs/src/parse.c:1.147
--- giFTcurs/src/parse.c:1.146 Sun Aug 31 14:45:42 2003
+++ giFTcurs/src/parse.c Mon Sep 15 17:24:34 2003
@@ -18,7 +18,7 @@
* along with giFTcurs; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
- * $Id: parse.c,v 1.146 2003/08/31 18:45:42 saturn Exp $
+ * $Id: parse.c,v 1.147 2003/09/15 21:24:34 saturn Exp $
*/
#include "giftcurs.h"
@@ -233,7 +233,9 @@
void parse_typed_query(const char *query, char **includes, char **excludes,
char **protocols)
{
char **tokens, **token;
+ /* *INDENT-OFF* */
dynarray incl = { 0 }, excl = { 0 }, prot = { 0 };
+ /* *INDENT-ON* */
tokens = g_strsplit(query, " ", -1);
@@ -245,6 +247,7 @@
for (proto = protos; *proto; proto++)
dynarray_append(&prot, *proto);
+ /* Just free the array, g_strfreev() destroys the
strings */
g_free(protos);
} else
dynarray_append(&incl, *token);
@@ -259,6 +262,7 @@
dynarray_removeall(&excl);
dynarray_removeall(&incl);
+ dynarray_foreach(&prot, g_free);
dynarray_removeall(&prot);
g_strfreev(tokens);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [giFTcurs-commits] giFTcurs/src parse.c,
Christian Häggström <=