Don't free stuff not belongs to us. Fix #7212 maybe #7213.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40480 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2011-02-13 21:50:15 +00:00
parent cdd1c5c679
commit a47656d480
1 changed files with 3 additions and 4 deletions

View File

@ -305,13 +305,12 @@ static int handle_non_rfc2047_encoding(char **buffer,size_t *bufferLength,size_t
// just to be sure
int32 destLength = length * 4 + 1;
int32 destBufferLength = destLength;
char *dest = (char *)malloc(destLength);
char *dest = (char*)malloc(destLength);
if (dest == NULL)
return 0;
if (convert_to_utf8(B_ISO1_CONVERSION,string,&length,dest,&destLength,&state) == B_OK)
{
free(*buffer);
if (convert_to_utf8(B_ISO1_CONVERSION, string, &length,dest,
&destLength, &state) == B_OK) {
*buffer = dest;
*bufferLength = destBufferLength;
*sourceLength = destLength;