From 61d8402fe26e229ee1cd6f6d2b469e2f2b60f513 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Thu, 12 Jul 2007 09:35:00 +0200 Subject: [PATCH] programs/cmd: Do the assignment after the return to avoid a missing free() (Coverity). --- programs/cmd/wcmdmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 247ee81c9ad..6d1e7d14980 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1647,11 +1647,11 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start) { *(colonpos+1) = savedchar; } - s = WCMD_strdupW(endOfVar + 1); - /* Command line - just ignore this */ if (context == NULL) return endOfVar+1; + s = WCMD_strdupW(endOfVar + 1); + /* Batch - replace unknown env var with nothing */ if (colonpos == NULL) { strcpyW (start, s);