diff options
| author | Chong Yidong | 2011-10-27 14:07:09 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-10-27 14:07:09 +0800 |
| commit | 9c6c6f495b8469ca5e105f5ddb02a69d1303a106 (patch) | |
| tree | 0858a59fdd543e7dca46fb6a3ab495c21c417f07 /src/process.c | |
| parent | 15de15c66d96905aa21f1781861067eebd68b24b (diff) | |
| download | emacs-9c6c6f495b8469ca5e105f5ddb02a69d1303a106.tar.gz emacs-9c6c6f495b8469ca5e105f5ddb02a69d1303a106.zip | |
Fix a memory leak in the built-in GnuTLS support.
* src/gnutls.c (emacs_gnutls_deinit): New function. Deallocate
credentials structures as well as calling gnutls_deinit.
(Fgnutls_deinit, Fgnutls_boot): Use it.
* src/process.c (make_process): Initialize GnuTLS credentials to NULL.
(deactivate_process): Call emacs_gnutls_deinit.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c index 90ad9c21681..3daa55b259e 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -642,6 +642,8 @@ make_process (Lisp_Object name) | |||
| 642 | p->gnutls_initstage = GNUTLS_STAGE_EMPTY; | 642 | p->gnutls_initstage = GNUTLS_STAGE_EMPTY; |
| 643 | p->gnutls_log_level = 0; | 643 | p->gnutls_log_level = 0; |
| 644 | p->gnutls_p = 0; | 644 | p->gnutls_p = 0; |
| 645 | p->gnutls_x509_cred = NULL; | ||
| 646 | p->gnutls_anon_cred = NULL; | ||
| 645 | #endif | 647 | #endif |
| 646 | 648 | ||
| 647 | /* If name is already in use, modify it until it is unused. */ | 649 | /* If name is already in use, modify it until it is unused. */ |
| @@ -3867,6 +3869,11 @@ deactivate_process (Lisp_Object proc) | |||
| 3867 | register int inchannel, outchannel; | 3869 | register int inchannel, outchannel; |
| 3868 | register struct Lisp_Process *p = XPROCESS (proc); | 3870 | register struct Lisp_Process *p = XPROCESS (proc); |
| 3869 | 3871 | ||
| 3872 | #ifdef HAVE_GNUTLS | ||
| 3873 | /* Delete GnuTLS structures in PROC, if any. */ | ||
| 3874 | emacs_gnutls_deinit (proc); | ||
| 3875 | #endif /* HAVE_GNUTLS */ | ||
| 3876 | |||
| 3870 | inchannel = p->infd; | 3877 | inchannel = p->infd; |
| 3871 | outchannel = p->outfd; | 3878 | outchannel = p->outfd; |
| 3872 | 3879 | ||