MINOR: ssl/crtlist: handle crt_path == cc->crt in crtlist_load_crt()
Handle the case where crt_path == cc->crt, so the pointer doesn't get free'd before getting strdup'ed in crtlist_load_crt().
This commit is contained in:
parent
6e91a7872e
commit
5821eb062a
@ -520,11 +520,14 @@ int crtlist_load_crt(char *crt_path, struct ckch_conf *cc, struct crtlist *newli
|
|||||||
if (ckchs == NULL) {
|
if (ckchs == NULL) {
|
||||||
if (stat(crt_path, &st) == 0) {
|
if (stat(crt_path, &st) == 0) {
|
||||||
found++;
|
found++;
|
||||||
free(cc->crt);
|
|
||||||
cc->crt = strdup(crt_path);
|
if (crt_path != cc->crt) {
|
||||||
if (cc->crt == NULL) {
|
free(cc->crt);
|
||||||
cfgerr |= ERR_ALERT | ERR_FATAL;
|
cc->crt = strdup(crt_path);
|
||||||
goto error;
|
if (cc->crt == NULL) {
|
||||||
|
cfgerr |= ERR_ALERT | ERR_FATAL;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ckchs = ckch_store_new_load_files_conf(crt_path, cc, err);
|
ckchs = ckch_store_new_load_files_conf(crt_path, cc, err);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user