From: Zbigniew Jędrzejewski-Szmek Date: Thu, 17 Nov 2016 21:25:01 +0000 (-0500) Subject: basic/env-uil: fix assertion failure in strv_env_replace (#4688) X-Git-Tag: v233~413 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a1e45b8ba3b8695d02cc12b42c46af6066f59766;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/basic/env-util.c b/src/basic/env-util.c index 7c69ccdaf94..96da38d45e3 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -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; }