From: Rasmus Lerdorf Date: Thu, 12 Nov 2009 01:09:16 +0000 (+0000) Subject: Fix bug #49098 X-Git-Tag: php-5.3.2RC1~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6502213b491e0caa8904f9cb27002d874f3cf4e;p=php Fix bug #49098 --- diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 0edbb1a4ec..0195b060ed 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -46,7 +46,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; + } } /* }}} */