Unverified Commit 650281ed authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

curl: fix memory leak reading --writeout from file

If another string had been set first, the writout function for reading
the syntax from file would leak the previously allocated memory.

Reported-by: Brian Carpenter
Fixes #3322
Closes #3330
parent 8e2549b8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2066,6 +2066,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
          fname = nextarg;
          file = fopen(nextarg, FOPEN_READTEXT);
        }
        Curl_safefree(config->writeout);
        err = file2string(&config->writeout, file);
        if(file && (file != stdin))
          fclose(file);