]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix fclose on error in TLS session ticket code.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 31 Jan 2020 06:49:14 +0000 (07:49 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 31 Jan 2020 06:49:14 +0000 (07:49 +0100)
doc/Changelog
util/net_help.c

index b152505456a4d5ddbab9916efaebc5993853c557..5640c44f7f08e94b78f90c597ec8332f7dad7155 100644 (file)
@@ -1,3 +1,6 @@
+31 January 2020: Wouter
+       - Fix fclose on error in TLS session ticket code.
+
 30 January 2020: Ralph
        - Fix memory leak in error condition remote.c
        - Fix double free in error condition view.c
index 8f83ec001bd1efdb034f46c9ccccbf022e2cfc44..0869f91f954e3801b3bd23ff380ab7230cffc956 100644 (file)
@@ -1279,12 +1279,13 @@ int listen_sslctx_setup_ticket_keys(void* sslctx, struct config_strlist* tls_ses
        for(p = tls_session_ticket_keys; p; p = p->next) {
                size_t n;
                unsigned char *data;
-               FILE *f = fopen(p->str, "r");
+               FILE *f;
 
                data = (unsigned char *)malloc(80);
                if(!data)
                        return 0;
 
+               f = fopen(p->str, "r");
                if(!f) {
                        log_err("could not read tls-session-ticket-key %s: %s", p->str, strerror(errno));
                        free(data);