projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f8e6e33
)
Fix an invalid free introduced in d01bb4028a9
author
Fabian Keil
<fk@fabiankeil.de>
Tue, 12 Nov 2019 11:44:41 +0000
(12:44 +0100)
committer
Fabian Keil
<fk@fabiankeil.de>
Tue, 12 Nov 2019 11:44:41 +0000
(12:44 +0100)
loaders.c
patch
|
blob
|
history
urlmatch.c
patch
|
blob
|
history
diff --git
a/loaders.c
b/loaders.c
index
65aba0a
..
1edf427
100644
(file)
--- a/
loaders.c
+++ b/
loaders.c
@@
-998,6
+998,8
@@
void unload_forward_spec(struct forward_spec *fwd)
free_pattern_spec(fwd->url);
freez(fwd->gateway_host);
freez(fwd->forward_host);
free_pattern_spec(fwd->url);
freez(fwd->gateway_host);
freez(fwd->forward_host);
+ freez(fwd->auth_username);
+ freez(fwd->auth_password);
free(fwd);
return;
free(fwd);
return;
diff --git
a/urlmatch.c
b/urlmatch.c
index
f1742c8
..
124cc6e
100644
(file)
--- a/
urlmatch.c
+++ b/
urlmatch.c
@@
-1440,20
+1440,23
@@
jb_err parse_forwarder_address(char *address, char **hostname, int *port,
char **username, char **password)
{
char *p;
char **username, char **password)
{
char *p;
- *hostname = strdup_or_die(address);
+ char *tmp;
+
+ tmp = *hostname = strdup_or_die(address);
/* Parse username and password */
if (username && password && (NULL != (p = strchr(*hostname, '@'))))
{
*p++ = '\0';
/* Parse username and password */
if (username && password && (NULL != (p = strchr(*hostname, '@'))))
{
*p++ = '\0';
- *username =
*hostname
;
- *hostname =
p
;
+ *username =
strdup_or_die(*hostname)
;
+ *hostname =
strdup_or_die(p)
;
if (NULL != (p = strchr(*username, ':')))
{
*p++ = '\0';
*password = strdup_or_die(p);
}
if (NULL != (p = strchr(*username, ':')))
{
*p++ = '\0';
*password = strdup_or_die(p);
}
+ freez(tmp);
}
/* Parse hostname and port */
}
/* Parse hostname and port */