Skip to content

Commit b6e81a0

Browse files
committed
casync: fix use of unitialized variable in cleanup
1 parent 179c8b8 commit b6e81a0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/gc.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,15 @@ int ca_chunk_collection_add_index(CaChunkCollection *coll, const char *path) {
124124
}
125125

126126
int ca_gc_cleanup_unused(CaStore *store, CaChunkCollection *coll, unsigned flags) {
127-
_cleanup_(ca_store_iterator_unrefp) CaStoreIterator* iter;
128-
int r;
129127
_cleanup_free_ char *ids = NULL;
130128
size_t ids_size = 0;
131129
size_t removed_chunks = 0, all_chunks = 0, removed_dirs = 0;
130+
int r;
132131

133132
if (!store || !coll)
134133
return -EINVAL;
135134

136-
iter = ca_store_iterator_new(store);
135+
_cleanup_(ca_store_iterator_unrefp) CaStoreIterator* iter = ca_store_iterator_new(store);
137136
if (!iter)
138137
return log_oom();
139138

0 commit comments

Comments
 (0)