BUG/MINOR: ssl: ssl_sock_load_sctl_from_file memory leak

"set ssl cert <filename.sctl> <payload>" CLI command must free
previous context.

This patch should be backport to 2.1
This commit is contained in:
Emmanuel Hocdet 2020-01-16 15:15:49 +01:00 committed by William Lallemand
parent eb73dc34bb
commit 224a087a27

View File

@ -1606,10 +1606,14 @@ static int ssl_sock_load_sctl_from_file(const char *sctl_path, char *buf, struct
sctl = NULL;
goto end;
}
ret = 0;
/* TODO: free the previous SCTL in the ckch */
/* no error, fill ckch with new context, old context must be free */
if (ckch->sctl) {
free(ckch->sctl->area);
ckch->sctl->area = NULL;
free(ckch->sctl);
}
ckch->sctl = sctl;
ret = 0;
end:
if (fd != -1)
close(fd);