From de05841d69e993140141b0fb9ac5f3298267052c Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Wed, 8 Jun 2016 15:27:04 -0700 Subject: [PATCH] x11/x11base.scm (x-get-window-property): Init data-return. Avoid freeing a bogus pointer when cleaning up. --- src/x11/x11base.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/x11/x11base.scm b/src/x11/x11base.scm index f493d6311..bcdc05cf1 100644 --- a/src/x11/x11base.scm +++ b/src/x11/x11base.scm @@ -752,7 +752,8 @@ USA. (alien-null! copy)))) (define (init-data-return! copy) - ((ucode-primitive c-malloc 2) copy (c-sizeof "* char"))) + ((ucode-primitive c-malloc 2) copy (c-sizeof "* char")) + (c->= copy "* char" 0)) (let ((data-return (make-alien '(* char)))) (add-alien-cleanup! data-return cleanup-data-return! init-data-return!) -- 2.25.1