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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user