Fix memory leak of operator certfp fields.

This commit is contained in:
Jilles Tjoelker 2011-01-25 00:39:07 +01:00
parent 6a00233824
commit 6cb47f18b5
2 changed files with 6 additions and 1 deletions

View File

@ -628,7 +628,7 @@ conf_end_oper(struct TopConf *tc)
}
if(!EmptyString(yy_oper->certfp))
yy_tmpoper->certfp = yy_oper->certfp;
yy_tmpoper->certfp = rb_strdup(yy_oper->certfp);
#endif
/* all is ok, put it on oper_conf_list */
@ -652,6 +652,8 @@ conf_set_oper_flags(void *data)
static void
conf_set_oper_fingerprint(void *data)
{
if (yy_oper->certfp)
rb_free(yy_oper->certfp);
yy_oper->certfp = rb_strdup((char *) data);
}
@ -1389,6 +1391,8 @@ conf_set_connect_accept_password(void *data)
static void
conf_set_connect_fingerprint(void *data)
{
if (yy_server->certfp)
rb_free(yy_server->certfp);
yy_server->certfp = rb_strdup((char *) data);
/* force SSL to be enabled if fingerprint is enabled. */

View File

@ -261,6 +261,7 @@ free_oper_conf(struct oper_conf *oper_p)
rb_free(oper_p->username);
rb_free(oper_p->host);
rb_free(oper_p->name);
rb_free(oper_p->certfp);
if(oper_p->passwd)
{