CID 1390: buf was leaked in case of error.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37962 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2010-08-07 23:30:35 +00:00
parent 385605d0c9
commit 3d8f229273

View File

@ -201,8 +201,10 @@ FireWireCard::DetectRecvFn()
buf = (char*)malloc(1024*16);
len = read(fDev, buf, 1024*16);
if (len < 0)
if (len < 0) {
free(buf);
return errno;
}
ptr = (u_int32_t*) buf;
ciph = (struct ciphdr*)(ptr + 1);