From 89f7058b99c24607dd371681435cc41e51fedf23 Mon Sep 17 00:00:00 2001
From: Paul Smith <psmith@gnu.org>
Date: Wed, 18 Jan 2012 13:31:11 +0000
Subject: [PATCH] Handle NULL returns from Guile.

---
 ChangeLog | 4 ++++
 guile.c   | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6fdc292d..58ce5280 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-01-17  Paul Smith  <psmith@gnu.org>
+
+	* guile.c (func_guile): Handle NULL returns from Guile.
+
 2012-01-16  Paul Smith  <psmith@gnu.org>
 
 	* make.h (PATH_SEPARATOR_CHAR): Allow resetting for crosscompiling
diff --git a/guile.c b/guile.c
index c32821a2..2a35e8b2 100644
--- a/guile.c
+++ b/guile.c
@@ -92,8 +92,11 @@ func_guile (char *o, char **argv, const char *funcname UNUSED)
   if (argv[0] && argv[0][0] != '\0')
     {
       char *str = scm_with_guile (internal_guile_eval, argv[0]);
-      o = variable_buffer_output (o, str, strlen (str));
-      free (str);
+      if (str)
+        {
+          o = variable_buffer_output (o, str, strlen (str));
+          free (str);
+        }
     }
 
   return o;