diff options
author | Omar Polo <op@omarpolo.com> | 2022-01-01 19:10:00 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2022-01-01 19:10:00 +0000 |
commit | 3c4b712bb2ef520be964da95fd627060f6639bf8 (patch) | |
tree | 98f2a99433176188f91be64b215551a95d3f2c7f /parse.y | |
parent | c7c8ef448bc8832998606ec217907c7dc66fec6c (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.y | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |