From 01170cfd3d5b6e5dfdc11c75f6e6740e8f938109 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Wed, 18 Nov 2015 09:03:34 -0700 Subject: * New version 2.20.10. * Fix typos in documentation (cotainer to container.) Reported by Holger Trapp. * Alpine does not remove remporary files created when adding a CA certificate to a container. Reported by Holger Trapp. --- pith/smkeys.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pith/smkeys.c') diff --git a/pith/smkeys.c b/pith/smkeys.c index 17357378..c5c24bcb 100644 --- a/pith/smkeys.c +++ b/pith/smkeys.c @@ -1205,11 +1205,8 @@ mem_add_extra_cacerts(char *contents, X509_LOOKUP *lookup) in = BIO_new_mem_buf(certtext, q-certtext); if(in){ tempfile = temp_nam(NULL, "az"); - out = NULL; - if(tempfile) - out = BIO_new_file(tempfile, "w"); - - if(out){ + out = tempfile != NULL ? BIO_new_file(tempfile, "w") : NULL; + if(out != NULL){ while((len = BIO_read(in, iobuf, sizeof(iobuf))) > 0) BIO_write(out, iobuf, len); @@ -1217,7 +1214,10 @@ mem_add_extra_cacerts(char *contents, X509_LOOKUP *lookup) if(!X509_LOOKUP_load_file(lookup, tempfile, X509_FILETYPE_PEM)) failed++; - fs_give((void **) &tempfile); + } + if(tempfile != NULL){ + unlink(tempfile); + fs_give((void **) &tempfile); } BIO_free(in); -- cgit v1.2.3-54-g00ecf