Commit 435c1d67 authored by Chong Yidong's avatar Chong Yidong

More gnutls memory fixes.

* src/gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
non-NULL, regardless of GNUTLS_INITSTAGE.
(Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
an error.  Set process slots as soon as we allocate them.

* src/gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.

* src/process.c (make_process): Set gnutls_state to NULL.
parent 416a2c45
2011-10-27 Chong Yidong <cyd@gnu.org>
* process.c (make_process): Set gnutls_state to NULL.
* gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
non-NULL, regardless of GNUTLS_INITSTAGE.
(Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
an error. Set process slots as soon as we allocate them.
* gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
2011-10-27 Chong Yidong <cyd@gnu.org>
* gnutls.c (emacs_gnutls_deinit): New function. Deallocate
......
This diff is collapsed.
......@@ -49,9 +49,9 @@ typedef enum
#define GNUTLS_PROCESS_USABLE(proc) (GNUTLS_INITSTAGE(proc) >= GNUTLS_STAGE_READY)
#define GNUTLS_LOG(level, max, string) if (level <= max) { gnutls_log_function (level, "(Emacs) " string); }
#define GNUTLS_LOG(level, max, string) do { if (level <= max) { gnutls_log_function (level, "(Emacs) " string); } } while (0)
#define GNUTLS_LOG2(level, max, string, extra) if (level <= max) { gnutls_log_function2 (level, "(Emacs) " string, extra); }
#define GNUTLS_LOG2(level, max, string, extra) do { if (level <= max) { gnutls_log_function2 (level, "(Emacs) " string, extra); } } while (0)
extern EMACS_INT
emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte);
......
......@@ -642,6 +642,7 @@ make_process (Lisp_Object name)
p->gnutls_initstage = GNUTLS_STAGE_EMPTY;
p->gnutls_log_level = 0;
p->gnutls_p = 0;
p->gnutls_state = NULL;
p->gnutls_x509_cred = NULL;
p->gnutls_anon_cred = NULL;
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment