summaryrefslogtreecommitdiff
path: root/mini-gmp
diff options
context:
space:
mode:
Diffstat (limited to 'mini-gmp')
-rw-r--r--mini-gmp/mini-mpq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mini-gmp/mini-mpq.c b/mini-gmp/mini-mpq.c
index fb0010653..8c3de9a24 100644
--- a/mini-gmp/mini-mpq.c
+++ b/mini-gmp/mini-mpq.c
@@ -515,6 +515,8 @@ mpq_out_str (FILE *stream, int base, const mpq_t x)
void (*gmp_free_func) (void *, size_t);
str = mpq_get_str (NULL, base, x);
+ if (!str)
+ return 0;
len = strlen (str);
n = fwrite (str, 1, len, stream);
mp_get_memory_functions (NULL, NULL, &gmp_free_func);