changeset 32406:6ee168374b2b

Fix a possible malloc(0). Not too sure if this can happen, though.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 22 Dec 2011 07:14:31 +0000
parents e4af50513560
children 025230c2f7dd
files libpurple/protocols/zephyr/ZRetSubs.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/zephyr/ZRetSubs.c	Thu Dec 22 06:28:12 2011 +0000
+++ b/libpurple/protocols/zephyr/ZRetSubs.c	Thu Dec 22 07:14:31 2011 +0000
@@ -132,6 +132,11 @@
 
 		__subscriptions_num = __subscriptions_num / 3;
 
+		if (!__subscriptions_num) {
+			ZFreeNotice(&retnotice);
+			continue;
+		}
+
 		__subscriptions_list = (ZSubscription_t *)
 			malloc((unsigned)(__subscriptions_num*
 					  sizeof(ZSubscription_t)));