Compare commits

..

17 Commits

Author SHA1 Message Date
Dylan Baker 90232914cd ci: run meson test with the address sanitizer enabled
Set the ASAN_OPTION so that the exitcode is not 1, this avoids asan
returning the exitcode that the tests already expect from a normal
pkgconf error
2022-08-04 15:22:29 -07:00
Dylan Baker 576ef1b949 pkg: prevent circular ownership
Otherwise in a case where A references B, and B references A, A and B
will have mutual ownership of each other and prevent each other from
being free'd.
2022-08-04 15:21:52 -07:00
Dylan Baker d3237407c4 queue: free unused dependencies when flattening 2022-08-04 15:21:52 -07:00
Dylan Baker 3bcf96dd01 dependency: zero list after freeing 2022-08-04 15:19:19 -07:00
Dylan Baker 1ac1cb51af dependency: add debug information for dependency refcounting 2022-08-04 15:19:19 -07:00
Dylan Baker c8933409aa pkg: add name of pkg being refed/unrefed to debug outpu 2022-08-04 15:19:19 -07:00
Dylan Baker f083d8d448 queue: when collecting dependents don't iterate private twice
Currently, the private field is iterated collecting private deps and
normal deps. It should only be iterated when collecting private deps.
2022-08-04 15:19:14 -07:00
Dylan Baker 7c671b155d main: do cleanup when checking required version 2022-08-04 15:19:05 -07:00
Dylan Baker 7fe770bec7 pkg: use goto cleanup idiom 2022-08-04 15:19:05 -07:00
Dylan Baker b26f19cebf main: goto cleanup in validate case too
This fixes leaks in two tests
2022-08-04 15:19:05 -07:00
Dylan Baker 2133830c21 cache: clear the cache with pkgconf_cache_remove
Which results in more code re-use.
2022-08-04 15:19:05 -07:00
Dylan Baker 2b310c570f queue: when flattening do nothing if the flattened deps are empty 2022-08-04 15:19:05 -07:00
Dylan Baker 43d5328575 queue: unref dependency in all cases 2022-08-04 15:19:05 -07:00
Dylan Baker 04a3346b8e queue: ensure cleanup happens when applying 2022-08-04 15:19:05 -07:00
Dylan Baker 388bd61a61 dependency: Fix reference counting of dependency_addraw
We only want a reference to be added for the value inserted into the
list, not the one returned. The returned one is unowned until it reaches
the public dependency_add function, which returns an owned pointer
instead. This makes things semantically more correct.

Unfortunately, this means in a few cases we have to write some ugly
code like:
```c
pkgconf_dependency_t *dep = pkgcond_dependency_add("args");
pkgconf_dependency_unref(dep->owner, dep);
```
2022-08-04 15:19:05 -07:00
Dylan Baker e41e464152 cache: when removing a package from the cache unset the cached flag 2022-08-03 15:53:16 -07:00
Dylan Baker 01c3e6f8b5 cache: free the cache table when it is empty and set to NULL
We do the latter for the benefit of libpkgconf. This cleans up a
significant number of memory leaks in the cache handling.
2022-08-03 15:53:16 -07:00

Diff Content Not Available