aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPip Cet2024-08-24 17:04:34 +0000
committerPip Cet2024-08-24 17:23:55 +0000
commit6682d0e6c96b0279929e3f47ae0820dd8a513d4b (patch)
tree08f2e493c21d054f2e4db5a70294462eb13f40c9 /src/alloc.c
parentab35741d43a6652a1c5c961b3b8001830a74f277 (diff)
downloademacs-6682d0e6c96b0279929e3f47ae0820dd8a513d4b.tar.gz
emacs-6682d0e6c96b0279929e3f47ae0820dd8a513d4b.zip
Fix gnutls crashes on MPS Windows builds
A more general mechanism to pin pointers used for external callbacks is needed. * src/process.h (struct Lisp_Process): Add 'gnutls_pproc' pointer to a pointer to ourselves. * src/alloc.c (cleanup_vector): Free 'gnutls_pproc'. * src/gnutls.c (emacs_gnutls_handshake): Allocate 'gnutls_pproc', and use it. * src/w32.c (emacs_gnutls_pull): (emacs_gnutls_push): Use indirection through 'gnutls_pproc'.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index f41cef9516a..4074adf3e6b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -44,6 +44,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
44#include "frame.h" 44#include "frame.h"
45#include "blockinput.h" 45#include "blockinput.h"
46#include "pdumper.h" 46#include "pdumper.h"
47#include "process.h"
47#include "termhooks.h" /* For struct terminal. */ 48#include "termhooks.h" /* For struct terminal. */
48#include "itree.h" 49#include "itree.h"
49#ifdef HAVE_WINDOW_SYSTEM 50#ifdef HAVE_WINDOW_SYSTEM
@@ -3569,12 +3570,17 @@ cleanup_vector (struct Lisp_Vector *vector)
3569 hash_table_allocated_bytes -= bytes; 3570 hash_table_allocated_bytes -= bytes;
3570 } 3571 }
3571 break; 3572 break;
3573 case PVEC_PROCESS:
3574 {
3575 struct Lisp_Process *p = PSEUDOVEC_STRUCT (vector, Lisp_Process);
3576 xfree (p->gnutls_pproc);
3577 }
3578 break;
3572 /* Keep the switch exhaustive. */ 3579 /* Keep the switch exhaustive. */
3573 case PVEC_NORMAL_VECTOR: 3580 case PVEC_NORMAL_VECTOR:
3574 case PVEC_FREE: 3581 case PVEC_FREE:
3575 case PVEC_SYMBOL_WITH_POS: 3582 case PVEC_SYMBOL_WITH_POS:
3576 case PVEC_MISC_PTR: 3583 case PVEC_MISC_PTR:
3577 case PVEC_PROCESS:
3578 case PVEC_FRAME: 3584 case PVEC_FRAME:
3579 case PVEC_WINDOW: 3585 case PVEC_WINDOW:
3580 case PVEC_BOOL_VECTOR: 3586 case PVEC_BOOL_VECTOR: