# HG changeset patch # User Eric Warmenhoven # Date 967767696 0 # Node ID f425f51a3db8f0e3f6fe99d02e51fd86ea99d623 # Parent aefd5f2b1ea0d0bfd42148d63e039b8d33f37d07 [gaim-migrate @ 828] libfaim committer: Tailor Script diff -r aefd5f2b1ea0 -r f425f51a3db8 libfaim/aim_tlv.c --- a/libfaim/aim_tlv.c Fri Sep 01 00:03:58 2000 +0000 +++ b/libfaim/aim_tlv.c Fri Sep 01 00:21:36 2000 +0000 @@ -45,9 +45,11 @@ cur->tlv = aim_createtlv(); cur->tlv->type = type; - cur->tlv->length = length; - cur->tlv->value = (u_char *)malloc(length*sizeof(u_char)); - memcpy(cur->tlv->value, buf+pos, length); + cur->tlv->length = length; + if (length) { + cur->tlv->value = (unsigned char *)malloc(length); + memcpy(cur->tlv->value, buf+pos, length); + } cur->next = list; list = cur;