Commit 65b6f4ae authored by Bernhard Link's avatar Bernhard Link

check where tree stuff is stored

parent 42310b4d
......@@ -21,7 +21,7 @@ AC_SYS_LARGEFILE
AC_C_BIGENDIAN()
AC_HEADER_STDBOOL
AC_CHECK_FUNCS([closefrom strndup dprintf])
AC_CHECK_FUNCS([closefrom strndup dprintf tdestroy])
found_mktemp=no
AC_CHECK_FUNCS([mkostemp mkstemp],[found_mktemp=yes ; break],)
if test "$found_mktemp" = "no" ; then
......
......@@ -4588,6 +4588,7 @@ static void myexit(int status) {
free(x_priority);
free(x_morguedir);
free(gnupghome);
pool_free();
exit(status);
}
......
......@@ -149,7 +149,7 @@ static retvalue remember_filekey(const char *filekey, char mode, char mode_and)
assert (c <= components_count());
h = realloc(file_changes_per_component,
sizeof(struct source_node*) * (c + 1));
sizeof(void*) * (c + 1));
if (FAILEDTOALLOC(h))
return RET_ERROR_OOM;
file_changes_per_component = h;
......@@ -778,3 +778,27 @@ void pool_tidyadded(bool delete) {
return;
}
#ifdef HAVE_TDESTROY
static void sourcename_free(void *n) {
struct source_node *node = n;
tdestroy(node->file_changes, free);
free(node);
}
#endif
void pool_free(void) {
#ifdef HAVE_TDESTROY
component_t c;
for (c = 1 ; c < reserved_components ; c++) {
tdestroy(file_changes_per_component[c], sourcename_free);
}
reserved_components = 0;
free(file_changes_per_component);
file_changes_per_component = NULL;
tdestroy(legacy_file_changes, free);
legacy_file_changes = NULL;
#endif
}
......@@ -25,4 +25,6 @@ void pool_tidyadded(bool deletenew);
/* delete and forget a single file */
retvalue pool_delete(const char *);
/* free all memory, to make valgrind happier */
void pool_free(void);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment