Fix CID 890. dest was leaked on error. To me it seems that src is leaked too,

and there's even a comment that says we are leaking memory.
Coverity doesn't complain, though, so I wonder if I'm wrong. Please someone
have a second look.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38241 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2010-08-18 16:25:31 +00:00
parent 5026e5cca4
commit 64bd6d9651
+3 -1
View File
@@ -369,8 +369,10 @@ status_t BSimpleMailAttachment::RenderToRFC822(BPositionIO *render_to) {
return B_NO_MEMORY;
destSize = encode (_encoding, dest, src, read, false /* headerMode */);
if (destSize < B_OK)
if (destSize < B_OK) {
free(dest);
return destSize;
}
if (destSize > 0)
read = render_to->Write(dest,destSize);
free (src);