From: Rasmus Lerdorf Date: Thu, 12 Nov 2009 08:20:57 +0000 (+0000) Subject: Fix for bug #49098 X-Git-Tag: php-5.4.0alpha1~191^2~2405 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a687ddcb4b7195688b6963f5bf5aadf5a69aee14;p=php Fix for bug #49098 --- diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 74e11ea9fc..7400641110 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -41,7 +41,11 @@ static void php_mysqli_set_error(long mysql_errno, char *mysql_err TSRMLS_DC) if (MyG(error_msg)) { efree(MyG(error_msg)); } - MyG(error_msg) = estrdup(mysql_err); + if(mysql_err && *mysql_err) { + MyG(error_msg) = estrdup(mysql_err); + } else { + MyG(error_msg) = NULL; + } } /* }}} */