file_internal.c guard file_cache_reset() from null pointer
I feel this is probably unlikely to be called with a NULL pointer for cachep but being that we are already doing the check why not guard file_cache_reset as well Change-Id: I1a13767ef28a4129ae3513f7aa999fb6c1d6fad8
This commit is contained in:
parent
6de6e1459d
commit
2df306923a
1 changed files with 7 additions and 5 deletions
|
@ -75,14 +75,16 @@ void file_cache_alloc(struct filestr_cache *cachep)
|
|||
/* free resources attached to the cache */
|
||||
void file_cache_free(struct filestr_cache *cachep)
|
||||
{
|
||||
if (cachep && cachep->buffer)
|
||||
if (cachep)
|
||||
{
|
||||
if(cachep->buffer)
|
||||
{
|
||||
dc_release_buffer(cachep->buffer);
|
||||
cachep->buffer = NULL;
|
||||
}
|
||||
|
||||
file_cache_reset(cachep);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Stream base APIs **/
|
||||
|
|
Loading…
Reference in a new issue