aboutsummaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-01-01 19:10:00 +0000
committerOmar Polo <op@omarpolo.com>2022-01-01 19:10:00 +0000
commit3c4b712bb2ef520be964da95fd627060f6639bf8 (patch)
tree98f2a99433176188f91be64b215551a95d3f2c7f /parse.y
parentc7c8ef448bc8832998606ec217907c7dc66fec6c (diff)
plug some memory leaks in config parsing
I forgot to free some strings when they're no more used.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 6359227..14af60d 100644
--- a/parse.y
+++ b/parse.y
@@ -209,6 +209,7 @@ option : CHROOT string { conf.chroot = $2; }
| PROTOCOLS string {
if (tls_config_parse_protocols(&conf.protos, $2) == -1)
yyerror("invalid protocols string \"%s\"", $2);
+ free($2);
}
| USER string { conf.user = $2; }
;
@@ -299,6 +300,7 @@ proxy_opt : CERT string {
p->cert = tls_load_file($2, &p->certlen, NULL);
if (p->cert == NULL)
yyerror("can't load cert %s", $2);
+ free($2);
}
| KEY string {
struct proxy *p = &host->proxy;
@@ -308,12 +310,14 @@ proxy_opt : CERT string {
p->key = tls_load_file($2, &p->keylen, NULL);
if (p->key == NULL)
yyerror("can't load key %s", $2);
+ free($2);
}
| PROTOCOLS string {
struct proxy *p = &host->proxy;
if (tls_config_parse_protocols(&p->protocols, $2) == -1)
yyerror("invalid protocols string \"%s\"", $2);
+ free($2);
}
| RELAY_TO string {
char *at;