[Commits] vcard-extension.c 1.3 1.4 vcard-utils.c 1.5 1.6

miras at claws-mail.org miras at claws-mail.org
Wed Jan 4 00:01:56 CET 2012


Update of /home/claws-mail/contacts/extensions/vcard/src
In directory claws-mail:/tmp/cvs-serv3744/extensions/vcard/src

Modified Files:
	vcard-extension.c vcard-utils.c 
Log Message:
2012-01-03 [mir]	0.6.0cvs72

	* extensions/vcard/src/vcard-extension.c
	* extensions/vcard/src/vcard-utils.c
	    Avoid very unlikely dereferencing a null-pointer.

Index: vcard-extension.c
===================================================================
RCS file: /home/claws-mail/contacts/extensions/vcard/src/vcard-extension.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- vcard-extension.c	1 Jan 2012 23:31:53 -0000	1.3
+++ vcard-extension.c	3 Jan 2012 23:01:54 -0000	1.4
@@ -241,11 +241,12 @@
 		if (error) {
 			show_message(item->mainwindow->window, GTK_UTIL_MESSAGE_ERROR, error);
 		}
-		else {
+		else if (o) {
 			count++;
 			writeVObject(fp, o);
 		}
-		cleanVObject(o);
+		if (o)
+			cleanVObject(o);
 	}
 	fclose(fp);
 

Index: vcard-utils.c
===================================================================
RCS file: /home/claws-mail/contacts/extensions/vcard/src/vcard-utils.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- vcard-utils.c	1 Jan 2012 23:51:54 -0000	1.5
+++ vcard-utils.c	3 Jan 2012 23:01:54 -0000	1.6
@@ -492,8 +492,10 @@
 	list = g_list_append(list, contact);
 	GSList* result = contacts2vcard(list, plugin, error);
 	glist_free(&list, NULL);
-	o = result->data;
-	gslist_free(&result, NULL);
+	if (result) {
+		o = result->data;
+		gslist_free(&result, NULL);
+	}
 	
 	return o;
 }



More information about the Commits mailing list