file_cache_delete() can now safely be used with a NULL pointer.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9938 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Vendored
+6
-3
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "vnode_store.h"
|
#include "vnode_store.h"
|
||||||
@@ -466,6 +466,9 @@ file_cache_delete(void *_cacheRef)
|
|||||||
{
|
{
|
||||||
file_cache_ref *ref = (file_cache_ref *)_cacheRef;
|
file_cache_ref *ref = (file_cache_ref *)_cacheRef;
|
||||||
|
|
||||||
|
if (ref == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
vfs_vnode_release_ref(ref->device);
|
vfs_vnode_release_ref(ref->device);
|
||||||
delete ref;
|
delete ref;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user