aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-06-28 00:28:31 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-06-28 00:28:31 +0800
commit1b6ebb2f7d18f51f732670b13f1aa66f79bea77f (patch)
tree08bd1d2c25765fb779d71ffd7d449e743ceb541d
parentff4c29fea3d08c181bbcb006908e7222f9c8cfaa (diff)
downloadgsoc2013-evolution-1b6ebb2f7d18f51f732670b13f1aa66f79bea77f.tar
gsoc2013-evolution-1b6ebb2f7d18f51f732670b13f1aa66f79bea77f.tar.gz
gsoc2013-evolution-1b6ebb2f7d18f51f732670b13f1aa66f79bea77f.tar.bz2
gsoc2013-evolution-1b6ebb2f7d18f51f732670b13f1aa66f79bea77f.tar.lz
gsoc2013-evolution-1b6ebb2f7d18f51f732670b13f1aa66f79bea77f.tar.xz
gsoc2013-evolution-1b6ebb2f7d18f51f732670b13f1aa66f79bea77f.tar.zst
gsoc2013-evolution-1b6ebb2f7d18f51f732670b13f1aa66f79bea77f.zip
When loading the description, strdup() the string in the XML tree so
that we don't crash when freeing the XML tree. svn path=/trunk/; revision=3761
-rw-r--r--filter/ChangeLog6
-rw-r--r--filter/filter-xml.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index c76176857f..437146336e 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,5 +1,11 @@
2000-06-27 Ettore Perazzoli <ettore@helixcode.com>
+ * filter-xml.c (load_desc): Strdup content before assigning the
+ value. Also, no need to check for NULL when g_strdup()ing as
+ g_strdup() returns NULL for a NULL arg.
+
+2000-06-27 Ettore Perazzoli <ettore@helixcode.com>
+
* Makefile.am (INCLUDES): `-I$(top_builddir)/shell' so that it
works with builddir != srcdir. [We need to #include
"Evolution.h".]
diff --git a/filter/filter-xml.c b/filter/filter-xml.c
index 1979ab76f7..dc8271ae7e 100644
--- a/filter/filter-xml.c
+++ b/filter/filter-xml.c
@@ -125,10 +125,10 @@ load_desc(xmlNodePtr node, int type, int vartype, char *varname)
while (node) {
if (node->content) {
desc = g_malloc0(sizeof(*desc));
- desc->data = node->content;
+ desc->data = g_strdup (node->content);
desc->type = type;
desc->vartype = vartype;
- desc->varname = varname?g_strdup(varname):0;
+ desc->varname = g_strdup(varname);
d(printf(" **** node name = %s var name = %s var type = %s\n", node->name, varname, detokenise(vartype)));
list = g_list_append(list, desc);
d(printf("appending '%s'\n", node->content));