From a687ddcb4b7195688b6963f5bf5aadf5a69aee14 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Thu, 12 Nov 2009 08:20:57 +0000 Subject: [PATCH] Fix for 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 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; + } } /* }}} */ -- 2.50.1