Merge branch 'ys/cygstart' into maint
[gitweb.git] / read-cache.c
index 7040e7962bc598d706f1c37dff953bd52c7ab42f..d97e3bf7cdb025de06ecf339059c38976355d8a5 100644 (file)
@@ -1518,8 +1518,9 @@ int discard_index(struct index_state *istate)
        free_name_hash(istate);
        cache_tree_free(&(istate->cache_tree));
        istate->initialized = 0;
-
-       /* no need to throw away allocated active_cache */
+       free(istate->cache);
+       istate->cache = NULL;
+       istate->cache_alloc = 0;
        return 0;
 }