If OPENSSL_CONF_INCLUDE has been set then we may leak the "include"
buffer.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11691)
OPENSSL_strlcpy(include_path, include_dir, newlen);
OPENSSL_strlcat(include_path, "/", newlen);
OPENSSL_strlcat(include_path, include, newlen);
OPENSSL_strlcpy(include_path, include_dir, newlen);
OPENSSL_strlcat(include_path, "/", newlen);
OPENSSL_strlcat(include_path, include, newlen);
} else {
include_path = include;
}
} else {
include_path = include;
}
next = process_include(include_path, &dirctx, &dirpath);
if (include_path != dirpath) {
/* dirpath will contain include in case of a directory */
next = process_include(include_path, &dirctx, &dirpath);
if (include_path != dirpath) {
/* dirpath will contain include in case of a directory */
- OPENSSL_free(include);
- if (include_path != include)
- OPENSSL_free(include_path);
+ OPENSSL_free(include_path);
}
#else
next = BIO_new_file(include_path, "r");
}
#else
next = BIO_new_file(include_path, "r");
- OPENSSL_free(include);
- if (include_path != include)
- OPENSSL_free(include_path);
+ OPENSSL_free(include_path);
#endif
if (next != NULL) {
#endif
if (next != NULL) {