31 lines
966 B
Diff
31 lines
966 B
Diff
|
|
From 650281ed5ba335d16a932ccba53665551197880f Mon Sep 17 00:00:00 2001
|
||
|
|
From: Daniel Stenberg <daniel@haxx.se>
|
||
|
|
Date: Fri, 30 Nov 2018 11:59:04 +0100
|
||
|
|
Subject: [PATCH 324/557] 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
|
||
|
|
---
|
||
|
|
src/tool_getparam.c | 1 +
|
||
|
|
1 file changed, 1 insertion(+)
|
||
|
|
|
||
|
|
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
|
||
|
|
index cd21f77..c0d3a84 100644
|
||
|
|
--- a/src/tool_getparam.c
|
||
|
|
+++ b/src/tool_getparam.c
|
||
|
|
@@ -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);
|
||
|
|
--
|
||
|
|
1.8.3.1
|
||
|
|
|