/pidgin/main: cda30ef360d0: g_malloc segfaults if it can't alloc...
Mark Doliner
mark at kingant.net
Tue Jan 28 10:38:10 EST 2014
Changeset: cda30ef360d0e792589d5d107bfd1fa785f558eb
Author: Mark Doliner <mark at kingant.net>
Date: 2014-01-11 21:41 -0800
Branch: release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/cda30ef360d0
Description:
g_malloc segfaults if it can't allocate the requested memory, so this
check is always false and therefore unnecessary.
diffstat:
libpurple/protocols/mxit/markup.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diffs (15 lines):
diff --git a/libpurple/protocols/mxit/markup.c b/libpurple/protocols/mxit/markup.c
--- a/libpurple/protocols/mxit/markup.c
+++ b/libpurple/protocols/mxit/markup.c
@@ -215,11 +215,6 @@ static int asn_getUtf8( const gchar* dat
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';
More information about the Commits
mailing list