basic/env-uil: fix assertion failure in strv_env_replace (#4688)

free_and_replace sets the setcond argument to NULL (it's designed
to be used with _clenaup_ macros), and we don't want that here.

Fixes #4684.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2016-11-17 22:25:01 +01:00
committed by Martin Pitt
parent 375fd1559b
commit a1e45b8ba3
+2 -1
View File
@@ -395,7 +395,8 @@ int strv_env_replace(char ***l, char *p) {
for (f = *l; f && *f; f++)
if (env_match(*f, p)) {
free_and_replace(*f, p);
free(*f);
*f = p;
strv_env_unset(f + 1, p);
return 0;
}