projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drop mem_alloc and mem_free, use my own hand crafted optmized macros that
[apps/madmutt.git]
/
mutt_ssl_gnutls.c
diff --git
a/mutt_ssl_gnutls.c
b/mutt_ssl_gnutls.c
index
4028629
..
a6e2cf4
100644
(file)
--- a/
mutt_ssl_gnutls.c
+++ b/
mutt_ssl_gnutls.c
@@
-20,6
+20,8
@@
#include <gnutls/openssl.h>
#endif
#include <gnutls/openssl.h>
#endif
+#include <lib-lib/mem.h>
+
#include "mutt.h"
#include "mutt_socket.h"
#include "mutt_curses.h"
#include "mutt.h"
#include "mutt_socket.h"
#include "mutt_curses.h"
@@
-161,7
+163,7
@@
static int tls_negotiate (CONNECTION * conn)
conn->sockdata = data;
err = gnutls_certificate_allocate_credentials (&data->xcred);
if (err < 0) {
conn->sockdata = data;
err = gnutls_certificate_allocate_credentials (&data->xcred);
if (err < 0) {
-
mem_free
(&conn->sockdata);
+
p_delete
(&conn->sockdata);
mutt_error (_("gnutls_certificate_allocate_credentials: %s"),
gnutls_strerror (err));
mutt_sleep (2);
mutt_error (_("gnutls_certificate_allocate_credentials: %s"),
gnutls_strerror (err));
mutt_sleep (2);
@@
-258,7
+260,7
@@
static int tls_negotiate (CONNECTION * conn)
fail:
gnutls_certificate_free_credentials (data->xcred);
gnutls_deinit (data->state);
fail:
gnutls_certificate_free_credentials (data->xcred);
gnutls_deinit (data->state);
-
mem_free
(&conn->sockdata);
+
p_delete
(&conn->sockdata);
return -1;
}
return -1;
}
@@
-271,7
+273,7
@@
static int tls_socket_close (CONNECTION * conn)
gnutls_certificate_free_credentials (data->xcred);
gnutls_deinit (data->state);
gnutls_certificate_free_credentials (data->xcred);
gnutls_deinit (data->state);
-
mem_fre
e(&conn->sockdata);
+
p_delet
e(&conn->sockdata);
}
return raw_socket_close (conn);
}
return raw_socket_close (conn);
@@
-321,7
+323,7
@@
static int tls_compare_certificates (const gnutls_datum * peercert)
do {
ret = gnutls_pem_base64_decode_alloc (NULL, &b64_data, &cert);
if (ret != 0) {
do {
ret = gnutls_pem_base64_decode_alloc (NULL, &b64_data, &cert);
if (ret != 0) {
-
mem_free
(&b64_data_data);
+
p_delete
(&b64_data_data);
return 0;
}
return 0;
}
@@
-335,7
+337,7
@@
static int tls_compare_certificates (const gnutls_datum * peercert)
if (memcmp (cert.data, peercert->data, cert.size) == 0) {
/* match found */
gnutls_free (cert.data);
if (memcmp (cert.data, peercert->data, cert.size) == 0) {
/* match found */
gnutls_free (cert.data);
-
mem_free
(&b64_data_data);
+
p_delete
(&b64_data_data);
return 1;
}
}
return 1;
}
}
@@
-344,7
+346,7
@@
static int tls_compare_certificates (const gnutls_datum * peercert)
} while (ptr != NULL);
/* no match found */
} while (ptr != NULL);
/* no match found */
-
mem_free
(&b64_data_data);
+
p_delete
(&b64_data_data);
return 0;
}
return 0;
}
@@
-417,7
+419,7
@@
static int tls_check_stored_hostname (const gnutls_datum * cert,
if (str_cmp (linestr + pmatch[1].rm_so, hostname) == 0 &&
str_cmp (linestr + pmatch[2].rm_so, buf) == 0) {
regfree (&preg);
if (str_cmp (linestr + pmatch[1].rm_so, hostname) == 0 &&
str_cmp (linestr + pmatch[2].rm_so, buf) == 0) {
regfree (&preg);
-
mem_fre
e(&linestr);
+
p_delet
e(&linestr);
fclose (fp);
return 1;
}
fclose (fp);
return 1;
}