1101 free(ze->name);
1102 free(ze->extra);
1103 free(ze->comment);
1104 free(ze);
1105 ze = NULL;
1106
1107 Finally:
1108 #ifdef USE_MMAP
1109 if (!zip->usemmap)
1110 #endif
1111 if (cen != NULL && accessHint == ACCESS_RANDOM) free(cen);
1112 return ze;
1113 }
1114
1115 /*
1116 * Free the given jzentry.
1117 * In fact we maintain a one-entry cache of the most recently used
1118 * jzentry for each zip. This optimizes a common access pattern.
1119 */
1120
1121 void
1122 ZIP_FreeEntry(jzfile *jz, jzentry *ze)
1123 {
1124 jzentry *last;
1125 ZIP_Lock(jz);
1126 last = jz->cache;
1127 jz->cache = ze;
1128 ZIP_Unlock(jz);
1129 if (last != NULL) {
1130 /* Free the previously cached jzentry */
1131 free(last->name);
1132 free(last->extra);
1133 free(last->comment);
1134 free(last);
1135 }
1136 }
1137
1138 /*
1139 * Returns the zip entry corresponding to the specified name, or
1140 * NULL if not found.
1141 */
|
1101 free(ze->name);
1102 free(ze->extra);
1103 free(ze->comment);
1104 free(ze);
1105 ze = NULL;
1106
1107 Finally:
1108 #ifdef USE_MMAP
1109 if (!zip->usemmap)
1110 #endif
1111 if (cen != NULL && accessHint == ACCESS_RANDOM) free(cen);
1112 return ze;
1113 }
1114
1115 /*
1116 * Free the given jzentry.
1117 * In fact we maintain a one-entry cache of the most recently used
1118 * jzentry for each zip. This optimizes a common access pattern.
1119 */
1120
1121 JNIEXPORT void
1122 ZIP_FreeEntry(jzfile *jz, jzentry *ze)
1123 {
1124 jzentry *last;
1125 ZIP_Lock(jz);
1126 last = jz->cache;
1127 jz->cache = ze;
1128 ZIP_Unlock(jz);
1129 if (last != NULL) {
1130 /* Free the previously cached jzentry */
1131 free(last->name);
1132 free(last->extra);
1133 free(last->comment);
1134 free(last);
1135 }
1136 }
1137
1138 /*
1139 * Returns the zip entry corresponding to the specified name, or
1140 * NULL if not found.
1141 */
|