Permalink
Browse files

tls_cert.dhfile freed multiple times (pull request #105)

- the pointer to the dhfile string was freed multiple times which in turn
  would cause a daemon crash
- removed all redundant lines, the pull request shows only part of the problem
- refers to bareos pull request #105 from gnif
  • Loading branch information...
franku committed Oct 10, 2018
1 parent 0d66917 commit f1e4e643cccc8512ef4d96ec7603350ca06e3dc6
@@ -191,8 +191,6 @@ static void FreeResource(CommonResourceHeader *sres, int type)
if (res->res_cons.tls_cert.keyfile) { delete res->res_cons.tls_cert.keyfile; }
if (res->res_cons.tls_cert.cipherlist) { delete res->res_cons.tls_cert.cipherlist; }
if (res->res_cons.tls_cert.dhfile) { delete res->res_cons.tls_cert.dhfile; }
if (res->res_cons.tls_cert.dhfile) { delete res->res_cons.tls_cert.dhfile; }
if (res->res_cons.tls_cert.dhfile) { delete res->res_cons.tls_cert.dhfile; }
if (res->res_cons.tls_cert.pem_message) { delete res->res_cons.tls_cert.pem_message; }
break;
case R_DIRECTOR:
@@ -208,8 +206,6 @@ static void FreeResource(CommonResourceHeader *sres, int type)
if (res->res_dir.tls_cert.keyfile) { delete res->res_dir.tls_cert.keyfile; }
if (res->res_dir.tls_cert.cipherlist) { delete res->res_dir.tls_cert.cipherlist; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.pem_message) { delete res->res_dir.tls_cert.pem_message; }
break;
default:
@@ -4031,8 +4031,6 @@ static void FreeResource(CommonResourceHeader *sres, int type)
if (res->res_dir.tls_cert.keyfile) { delete res->res_dir.tls_cert.keyfile; }
if (res->res_dir.tls_cert.cipherlist) { delete res->res_dir.tls_cert.cipherlist; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.pem_message) { delete res->res_dir.tls_cert.pem_message; }
break;
case R_DEVICE:
@@ -4066,8 +4064,6 @@ static void FreeResource(CommonResourceHeader *sres, int type)
if (res->res_con.tls_cert.keyfile) { delete res->res_con.tls_cert.keyfile; }
if (res->res_con.tls_cert.cipherlist) { delete res->res_con.tls_cert.cipherlist; }
if (res->res_con.tls_cert.dhfile) { delete res->res_con.tls_cert.dhfile; }
if (res->res_con.tls_cert.dhfile) { delete res->res_con.tls_cert.dhfile; }
if (res->res_con.tls_cert.dhfile) { delete res->res_con.tls_cert.dhfile; }
if (res->res_con.tls_cert.pem_message) { delete res->res_con.tls_cert.pem_message; }
break;
case R_CLIENT:
@@ -4087,8 +4083,6 @@ static void FreeResource(CommonResourceHeader *sres, int type)
if (res->res_client.tls_cert.keyfile) { delete res->res_client.tls_cert.keyfile; }
if (res->res_client.tls_cert.cipherlist) { delete res->res_client.tls_cert.cipherlist; }
if (res->res_client.tls_cert.dhfile) { delete res->res_client.tls_cert.dhfile; }
if (res->res_client.tls_cert.dhfile) { delete res->res_client.tls_cert.dhfile; }
if (res->res_client.tls_cert.dhfile) { delete res->res_client.tls_cert.dhfile; }
if (res->res_client.tls_cert.pem_message) { delete res->res_client.tls_cert.pem_message; }
break;
case R_STORAGE:
@@ -4127,8 +4121,6 @@ static void FreeResource(CommonResourceHeader *sres, int type)
if (res->res_store.tls_cert.keyfile) { delete res->res_store.tls_cert.keyfile; }
if (res->res_store.tls_cert.cipherlist) { delete res->res_store.tls_cert.cipherlist; }
if (res->res_store.tls_cert.dhfile) { delete res->res_store.tls_cert.dhfile; }
if (res->res_store.tls_cert.dhfile) { delete res->res_store.tls_cert.dhfile; }
if (res->res_store.tls_cert.dhfile) { delete res->res_store.tls_cert.dhfile; }
if (res->res_store.tls_cert.pem_message) { delete res->res_store.tls_cert.pem_message; }
break;
case R_CATALOG:
@@ -408,8 +408,6 @@ static void FreeResource(CommonResourceHeader *sres, int type)
if (res->res_dir.tls_cert.keyfile) { delete res->res_dir.tls_cert.keyfile; }
if (res->res_dir.tls_cert.cipherlist) { delete res->res_dir.tls_cert.cipherlist; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.pem_message) { delete res->res_dir.tls_cert.pem_message; }
break;
case R_CLIENT:
@@ -455,8 +453,6 @@ static void FreeResource(CommonResourceHeader *sres, int type)
if (res->res_client.tls_cert.keyfile) { delete res->res_client.tls_cert.keyfile; }
if (res->res_client.tls_cert.cipherlist) { delete res->res_client.tls_cert.cipherlist; }
if (res->res_client.tls_cert.dhfile) { delete res->res_client.tls_cert.dhfile; }
if (res->res_client.tls_cert.dhfile) { delete res->res_client.tls_cert.dhfile; }
if (res->res_client.tls_cert.dhfile) { delete res->res_client.tls_cert.dhfile; }
if (res->res_client.tls_cert.pem_message) { delete res->res_client.tls_cert.pem_message; }
break;
case R_MSGS:
@@ -828,8 +828,6 @@ static void FreeResource(CommonResourceHeader *sres, int type)
if (res->res_dir.tls_cert.keyfile) { delete res->res_dir.tls_cert.keyfile; }
if (res->res_dir.tls_cert.cipherlist) { delete res->res_dir.tls_cert.cipherlist; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.dhfile) { delete res->res_dir.tls_cert.dhfile; }
if (res->res_dir.tls_cert.pem_message) { delete res->res_dir.tls_cert.pem_message; }
break;
case R_NDMP:
@@ -867,8 +865,6 @@ static void FreeResource(CommonResourceHeader *sres, int type)
if (res->res_store.tls_cert.keyfile) { delete res->res_store.tls_cert.keyfile; }
if (res->res_store.tls_cert.cipherlist) { delete res->res_store.tls_cert.cipherlist; }
if (res->res_store.tls_cert.dhfile) { delete res->res_store.tls_cert.dhfile; }
if (res->res_store.tls_cert.dhfile) { delete res->res_store.tls_cert.dhfile; }
if (res->res_store.tls_cert.dhfile) { delete res->res_store.tls_cert.dhfile; }
if (res->res_store.tls_cert.pem_message) { delete res->res_store.tls_cert.pem_message; }
break;
case R_DEVICE:

0 comments on commit f1e4e64

Please sign in to comment.