From c6502213b491e0caa8904f9cb27002d874f3cf4e Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Thu, 12 Nov 2009 01:09:16 +0000 Subject: [PATCH] Fix bug #49098 --- ext/mysqli/mysqli_nonapi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; + } } /* }}} */ -- 2.40.0