g_malloc segfaults if it can't allocate the requested memory, so this release-2.x.y

Sat, 11 Jan 2014 21:41:52 -0800

author
Mark Doliner <mark@kingant.net>
date
Sat, 11 Jan 2014 21:41:52 -0800
branch
release-2.x.y
changeset 35223
cda30ef360d0
parent 35222
6057ecea67bf
child 35224
dfe26ea283ee

g_malloc segfaults if it can't allocate the requested memory, so this
check is always false and therefore unnecessary.

libpurple/protocols/mxit/markup.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/mxit/markup.c	Thu Jan 09 22:45:16 2014 -0800
+++ b/libpurple/protocols/mxit/markup.c	Sat Jan 11 21:41:52 2014 -0800
@@ -215,11 +215,6 @@
 
 	len = (uint8_t)data[1]; /* length field [1 byte] */
 	out_str = g_malloc(len + 1);
-	if (out_str == NULL) {
-		purple_debug_fatal(MXIT_PLUGIN_ID, "asn_getUtf8: out of memory");
-		return -1;
-	}
-
 	memcpy(out_str, &data[2], len); /* data field */
 	out_str[len] = '\0';
 

mercurial