fix compilation on old distros

pull/4165/head
Miro Stauder 3 years ago
parent 34054560a2
commit a8019413c4

@ -10,17 +10,18 @@
#define CONNECT_TIMEOUT 0
struct st_mariadb_methods MARIADB_DEFAULT_METHODS;
@@ -4078,6 +4083,18 @@
@@ -4078,6 +4083,19 @@
void STDCALL mysql_thread_end(void)
{
+ if (local_x509_files != NULL) {
+ for (int i=0; local_x509_files[i] != NULL ; i++) {
+ int i;
+ for (i=0; local_x509_files[i] != NULL ; i++) {
+ free(local_x509_files[i]);
+ free(local_x509_sha1s[i]);
+ }
+ free(local_x509_files);
+ free(local_x509_sha1s);
+ free(local_x509_files);
+ free(local_x509_sha1s);
+ }
+ if (thread_ctx != NULL) {
+ SSL_CTX_free(thread_ctx);

@ -35,14 +35,14 @@
+
+ if(fstat(fd, &statbuf) == 0) {
+ unsigned char *fb = (unsigned char *)mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
+ if (fb != MAP_FAILED) {
+
+ SHA1(fb, statbuf.st_size, temp);
+ for (int i=0; i < SHA_DIGEST_LENGTH; i++) {
+ sprintf((char*)&(file_sha1[i*2]), "%02x", temp[i]);
+ }
+ munmap(fb,statbuf.st_size);
+ } else {
+ if (fb != MAP_FAILED) {
+ SHA1(fb, statbuf.st_size, temp);
+ int i;
+ for (i=0; i < SHA_DIGEST_LENGTH; i++) {
+ sprintf((char*)&(file_sha1[i*2]), "%02x", temp[i]);
+ }
+ munmap(fb,statbuf.st_size);
+ } else {
+ return 0;
+ }
+ } else {

Loading…
Cancel
Save