summaryrefslogtreecommitdiff
path: root/firmware/common/dircache.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/dircache.c')
-rw-r--r--firmware/common/dircache.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c
index 7a84b761a0..8917b3348e 100644
--- a/firmware/common/dircache.c
+++ b/firmware/common/dircache.c
@@ -1963,8 +1963,7 @@ static int prepare_build(bool *realloced)
1963 int handle = reset_buffer(); 1963 int handle = reset_buffer();
1964 dircache_unlock(); 1964 dircache_unlock();
1965 1965
1966 if (handle > 0) 1966 core_free(handle);
1967 core_free(handle);
1968 1967
1969 handle = alloc_cache(size); 1968 handle = alloc_cache(size);
1970 1969
@@ -2164,8 +2163,7 @@ static void dircache_suspend_internal(bool freeit)
2164 2163
2165 dircache_unlock(); 2164 dircache_unlock();
2166 2165
2167 if (handle > 0) 2166 core_free(handle);
2168 core_free(handle);
2169 2167
2170 thread_wait(thread_id); 2168 thread_wait(thread_id);
2171 2169
@@ -3179,7 +3177,7 @@ error:
3179 dircache_unlock(); 3177 dircache_unlock();
3180 3178
3181error_nolock: 3179error_nolock:
3182 if (rc < 0 && handle > 0) 3180 if (rc < 0)
3183 core_free(handle); 3181 core_free(handle);
3184 3182
3185 if (fd >= 0) 3183 if (fd >= 0)