]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: ssl: ssl_sock_load_crt_file_into_ckch
authorEmmanuel Hocdet <manu@gandi.net>
Tue, 4 Dec 2018 16:37:47 +0000 (17:37 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 30 Jul 2019 15:54:34 +0000 (17:54 +0200)
Fix comments for this function and remove free before alloc call: ckch
call is correctly balanced  (alloc/free).

src/ssl_sock.c

index 1cc4607f6657768b6ed2f8a52e3e12a7a165e156..bcaf5eddc34d0df018f6521611847f6b7e205e5f 100644 (file)
@@ -2937,11 +2937,11 @@ static int ssl_sock_is_ckch_valid(struct cert_key_and_chain *ckch)
 /* Loads the contents of a crt file (path) into a cert_key_and_chain
  * This allows us to carry the contents of the file without having to
  * read the file multiple times.
+ * The caller must call ssl_sock_free_cert_key_and_chain_contents.
  *
  * returns:
  *      0 on Success
  *      1 on SSL Failure
- *      2 on file not found
  */
 static int ssl_sock_load_crt_file_into_ckch(const char *path, struct cert_key_and_chain *ckch, char **err)
 {
@@ -2950,8 +2950,6 @@ static int ssl_sock_load_crt_file_into_ckch(const char *path, struct cert_key_an
        X509 *ca;
        int ret = 1;
 
-       ssl_sock_free_cert_key_and_chain_contents(ckch);
-
        in = BIO_new(BIO_s_file());
        if (in == NULL)
                goto end;