Fix dodgy libxml allocation pollution, and potential faults on NULL

2001-02-03  Michael Meeks  <michael@helixcode.com>

	* mail-local.c (load_metainfo): Fix dodgy libxml allocation
	pollution, and potential faults on NULL attributes.

svn path=/trunk/; revision=7949
This commit is contained in:
Michael Meeks
2001-02-03 22:56:15 +00:00
committed by Michael Meeks
parent 939160fe57
commit 5011c8574c
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2001-02-03 Michael Meeks <michael@helixcode.com>
* mail-local.c (load_metainfo): Fix dodgy libxml allocation
pollution, and potential faults on NULL attributes.
2001-02-02 Not Zed <NotZed@Ximian.com>
* mail-send-recv.c (mail_send_receive): Cleaned up so we dont add

View File

@ -97,9 +97,16 @@ load_metainfo(const char *path)
node = node->childs;
while (node) {
if (!strcmp(node->name, "folder")) {
char *index;
meta->format = xmlGetProp(node, "type");
meta->name = xmlGetProp(node, "name");
char *index, *txt;
txt = xmlGetProp(node, "type");
meta->format = g_strdup (txt ? txt : "mbox");
xmlFree (txt);
txt = xmlGetProp(node, "name");
meta->name = g_strdup (txt ? txt : "mbox");
xmlFree (txt);
index = xmlGetProp(node, "index");
if (index) {
meta->indexed = atoi(index);