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:
parent
385605d0c9
commit
3d8f229273
@ -201,8 +201,10 @@ FireWireCard::DetectRecvFn()
|
|||||||
|
|
||||||
buf = (char*)malloc(1024*16);
|
buf = (char*)malloc(1024*16);
|
||||||
len = read(fDev, buf, 1024*16);
|
len = read(fDev, buf, 1024*16);
|
||||||
if (len < 0)
|
if (len < 0) {
|
||||||
|
free(buf);
|
||||||
return errno;
|
return errno;
|
||||||
|
}
|
||||||
ptr = (u_int32_t*) buf;
|
ptr = (u_int32_t*) buf;
|
||||||
ciph = (struct ciphdr*)(ptr + 1);
|
ciph = (struct ciphdr*)(ptr + 1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user