mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-21 15:28:50 -05:00
Fix memory leak in remove_notify_needed_optdepends
Also add pactest which captures this leak when run under valgrind. Reported-by: Sergey Petrenko Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
d560a9aecd
commit
fac4831a09
@ -189,6 +189,7 @@ static void remove_notify_needed_optdepends(alpm_handle_t *handle, alpm_list_t *
|
||||
};
|
||||
EVENT(handle, &event);
|
||||
}
|
||||
free(optstring);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,6 +109,7 @@ TESTS += test/pacman/tests/querycheck002.py
|
||||
TESTS += test/pacman/tests/querycheck_fast_file_type.py
|
||||
TESTS += test/pacman/tests/reason001.py
|
||||
TESTS += test/pacman/tests/remove-assumeinstalled.py
|
||||
TESTS += test/pacman/tests/remove-optdepend-of-installed-package.py
|
||||
TESTS += test/pacman/tests/remove-recursive-cycle.py
|
||||
TESTS += test/pacman/tests/remove001.py
|
||||
TESTS += test/pacman/tests/remove002.py
|
||||
|
15
test/pacman/tests/remove-optdepend-of-installed-package.py
Normal file
15
test/pacman/tests/remove-optdepend-of-installed-package.py
Normal file
@ -0,0 +1,15 @@
|
||||
self.description = "Remove packages which is an optdepend of another package"
|
||||
|
||||
p1 = pmpkg("dep")
|
||||
self.addpkg2db("local", p1)
|
||||
|
||||
p2 = pmpkg("pkg")
|
||||
p2.optdepends = ["dep: for foobar"]
|
||||
self.addpkg2db("local", p2)
|
||||
|
||||
self.args = "-R %s" % p1.name
|
||||
|
||||
self.addrule("PACMAN_RETCODE=0")
|
||||
self.addrule("!PKG_EXIST=%s" % p1.name)
|
||||
self.addrule("PKG_EXIST=%s" % p2.name)
|
||||
self.addrule("PACMAN_OUTPUT=%s optionally requires %s" % (p2.name, p1.name))
|
Loading…
Reference in New Issue
Block a user