1
0
Fork 0
forked from len0rd/rockbox

move buflib_free invalid handle check to the function

allow buflib_free to check for invalid or already freed handles
within the function -- remove all the invalid handle guards thru core_free

Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
This commit is contained in:
William Wilgus 2022-10-15 09:08:09 -04:00 committed by William Wilgus
parent 9d3d925295
commit 12ef045fdf
18 changed files with 32 additions and 62 deletions

View file

@ -1963,8 +1963,7 @@ static int prepare_build(bool *realloced)
int handle = reset_buffer();
dircache_unlock();
if (handle > 0)
core_free(handle);
core_free(handle);
handle = alloc_cache(size);
@ -2164,8 +2163,7 @@ static void dircache_suspend_internal(bool freeit)
dircache_unlock();
if (handle > 0)
core_free(handle);
core_free(handle);
thread_wait(thread_id);
@ -3179,7 +3177,7 @@ error:
dircache_unlock();
error_nolock:
if (rc < 0 && handle > 0)
if (rc < 0)
core_free(handle);
if (fd >= 0)