diff options
| author | Anton <anton@picapica> | 2019-02-21 23:11:19 +0400 |
|---|---|---|
| committer | Anton <anton@picapica> | 2019-02-21 23:11:19 +0400 |
| commit | 375a28154b5822cbc32be4aed2a9835422596a87 (patch) | |
| tree | c8cf0b0de9a658cc39c8245854cc4b49c7ebee45 /PICA_client.c | |
| parent | 570e7f072cef92fd45dd9fa3bf4d545dbfb1fd64 (diff) | |
| download | pica-pica-375a28154b5822cbc32be4aed2a9835422596a87.tar.gz pica-pica-375a28154b5822cbc32be4aed2a9835422596a87.zip | |
bugfix, make copy of file paths
Diffstat (limited to 'PICA_client.c')
| -rw-r--r-- | PICA_client.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/PICA_client.c b/PICA_client.c index cdabf93..fb1c9ec 100644 --- a/PICA_client.c +++ b/PICA_client.c @@ -1421,8 +1421,8 @@ int PICA_open_acc(const char *cert_file, if (!a) return PICA_ERRNOMEM; - a->pkey_file = pkey_file; - a->cert_file = cert_file; + a->pkey_file = strdup(pkey_file); + a->cert_file = strdup(cert_file); a->password_cb = password_cb; a->ctx = SSL_CTX_new(TLSv1_2_method());//(2) @@ -1523,6 +1523,8 @@ error_ret_2: //(2) SSL_CTX_free(a->ctx); error_ret_1: //(1) + free(a->pkey_file); + free(a->cert_file); free(a); *acc = 0; @@ -3469,6 +3471,8 @@ void PICA_close_c2n(struct PICA_c2n *cid) void PICA_close_acc(struct PICA_acc *a) { SSL_CTX_free(a->ctx); + free(a->pkey_file); + free(a->cert_file); free(a); } |
