+/*
+ * Copyright (C) 2012 Eric Biggers
+ *
+ * This file is part of wimlib, a library for working with WIM files.
+ *
+ * wimlib is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wimlib; if not, see http://www.gnu.org/licenses/.
+ */
+
#include "dentry.h"
#include "io.h"
#include "lookup_table.h"
if (!ads_entries)
return WIMLIB_ERR_NOMEM;
memcpy(ads_entries[1].hash, symlink_buf_hash, WIM_HASH_SIZE);
- dentry_free_ads_entries(dentry);
+ wimlib_assert(dentry->num_ads == 0);
+ wimlib_assert(!dentry->ads_entries);
+ /*dentry_free_ads_entries(dentry);*/
dentry->num_ads = 2;
dentry->ads_entries = ads_entries;
return 0;
if (existing_lte) {
existing_lte->refcnt++;
+ lte = existing_lte;
} else {
DEBUG("Creating new lookup table entry for symlink buf");
lte = new_lookup_table_entry();
*lte_ret = lte;
return 0;
out_free_lte:
- FREE(lte);
+ if (lte != existing_lte)
+ FREE(lte);
out_free_symlink_buf:
FREE(symlink_buf);
return ret;