Paul Vriens : programs/cmd: Do the assignment after the return to avoid a missing free() (Coverity).

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jul 12 08:32:27 CDT 2007


Module: wine
Branch: master
Commit: 61d8402fe26e229ee1cd6f6d2b469e2f2b60f513
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=61d8402fe26e229ee1cd6f6d2b469e2f2b60f513

Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date:   Thu Jul 12 09:35:00 2007 +0200

programs/cmd: Do the assignment after the return to avoid a missing free() (Coverity).

---

 programs/cmd/wcmdmain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 247ee81..6d1e7d1 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);




More information about the wine-cvs mailing list