Memory leak in error case. CID 873.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25642 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-05-24 16:04:57 +00:00
parent 06a28b5416
commit 7ad3cf0bc3
1 changed files with 3 additions and 1 deletions

View File

@ -2965,8 +2965,10 @@ devfs_publish_file_device(const char *path, const char *filePath)
RecursiveLocker locker(&sDeviceFileSystem->lock);
status = new_node(sDeviceFileSystem, path, &node, &dirNode);
if (status != B_OK)
if (status != B_OK) {
free((char*)filePath);
return status;
}
// all went fine, let's initialize the node
node->stream.type = S_IFLNK | 0644;