Mercurial > pidgin
diff libgaim/protocols/msn/object.c @ 14987:dc9ed6c44c48
[gaim-migrate @ 17766]
This should prevent a crash when reading a malformed custom emoticon.
Also add some debuggering output for when this happens to see if we can figure out the exact scenario.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Fri, 17 Nov 2006 04:31:21 +0000 |
parents | 4e14503b9bac |
children | e354528c4163 |
line wrap: on
line diff
--- a/libgaim/protocols/msn/object.c Fri Nov 17 03:29:45 2006 +0000 +++ b/libgaim/protocols/msn/object.c Fri Nov 17 04:31:21 2006 +0000 @@ -22,6 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "object.h" +#include "debug.h" #define GET_STRING_TAG(field, id) \ if ((tag = strstr(str, id "=\"")) != NULL) \ @@ -94,6 +95,7 @@ if (obj->creator == NULL || obj->size == 0 || obj->type == 0 || obj->location == NULL || obj->friendly == NULL || obj->sha1d == NULL || obj->sha1c == NULL) { + gaim_debug_error("msn", "Discarding invalid msnobj: '%s'\n", str); msn_object_destroy(obj); obj = NULL; } @@ -106,23 +108,12 @@ { g_return_if_fail(obj != NULL); - if (obj->creator != NULL) - g_free(obj->creator); - - if (obj->location != NULL) - g_free(obj->location); - - if (obj->real_location != NULL) - g_free(obj->real_location); - - if (obj->friendly != NULL) - g_free(obj->friendly); - - if (obj->sha1d != NULL) - g_free(obj->sha1d); - - if (obj->sha1c != NULL) - g_free(obj->sha1c); + g_free(obj->creator); + g_free(obj->location); + g_free(obj->real_location); + g_free(obj->friendly); + g_free(obj->sha1d); + g_free(obj->sha1c); if (obj->local) local_objs = g_list_remove(local_objs, obj);