diff --git a/caca-php/php_caca.c b/caca-php/php_caca.c index 055df65..a4d657d 100644 --- a/caca-php/php_caca.c +++ b/caca-php/php_caca.c @@ -1259,6 +1259,9 @@ PHP_FUNCTION(caca_export_string) { void *buffer; size_t len; buffer = caca_export_memory(canvas, type, &len); + if (!buffer) { + RETURN_FALSE; + } return_value->type = IS_STRING; return_value->value.str.len = len; return_value->value.str.val = emalloc(len);